8223813: (aio) Iocp.getErrorMessage should drop trailing \r\n
Brian Burkhalter
brian.burkhalter at oracle.com
Wed Jun 12 23:26:52 UTC 2019
Hi Ivan,
> On Jun 12, 2019, at 4:03 PM, Ivan Gerasimov <ivan.gerasimov at oracle.com> wrote:
>
> On 6/12/19 10:02 AM, Brian Burkhalter wrote:
>> Actually, never mind, I am being completely lame here: both NET_ThrowNew() and the Windows function LocalFree() are robust to a NULL-valued buf so I think we can just remove the n > 0 or buf == NULL check altogether.
>>
> That's true, assuming that you initialize buf = NULL and hopping that FormatMessage won't change buf upon failure.
True.
> I wish MSDN were a little bit more specific here.
Likewise.
> I am fine with
>
> 1)
> 362 TCHAR *buf = NULL;
>
> 2)
> unconditional
> 395 NET_ThrowNew(env, err, buf);
> 396 LocalFree(buf);
Barring objections I will check it in with the above code after the JDK 13 fork.
Thanks,
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190612/4c0f040d/attachment.html>
More information about the nio-dev
mailing list