Re: [PATCH 02/10] chardev/char-socket: tcp_chr_recv: don't clobber errno

2021-11-12 Thread Marc-André Lureau
On Thu, Nov 11, 2021 at 7:38 PM Roman Kagan wrote: > tcp_chr_recv communicates the specific error condition to the caller via > errno. However, after setting it, it may call into some system calls or > library functions which can clobber the errno. > > Avoid this by moving the errno assignment

[PATCH 02/10] chardev/char-socket: tcp_chr_recv: don't clobber errno

2021-11-11 Thread Roman Kagan
tcp_chr_recv communicates the specific error condition to the caller via errno. However, after setting it, it may call into some system calls or library functions which can clobber the errno. Avoid this by moving the errno assignment to the end of the function. Signed-off-by: Roman Kagan ---