nuttx-apps/netutils/webclient
YAMAMOTO Takashi 83324b68f9 webclient: Fix errno in case of recv failure
When recv() failed, the current code assumes the return value
of recv() is a negative errno. It's wrong. Actually the return value
in case of error is -1. The wrong assumption ends up with reporting
EPERM, as EPERM happens to be -(-1).

This commit changes the code to leave the errno set by the failed
recv() as it is. It should be fine as wget_base() has the same
error returning convention as recv(). That is, return -1 (ERROR)
and set errno in the case of failure.

NOTE: the close() after the errout label can also fail and overwrite
the errno. I don't feel it's a big problem as wget_base() doesn't have
any promise about which error should be reported.
2020-06-12 05:22:45 -07:00
..
Kconfig webclient: Fix http -> https redirection 2020-05-26 15:38:12 +08:00
Make.defs Remove extra whitespace from files (#43) 2020-01-31 08:29:24 -06:00
Makefile build: Remove the workaround for the inexistence of .config/Make.defs 2020-05-21 17:43:42 +01:00
webclient.c webclient: Fix errno in case of recv failure 2020-06-12 05:22:45 -07:00