Skip to content
Commit a4cc88ad authored by Gil Pitney's avatar Gil Pitney Committed by Anas Nashif
Browse files

samples: net: sockets: echo-client: fix sock fd test, allow zero.

Per: http://pubs.opengroup.org/onlinepubs/009695399/functions/socket.html


"Upon successful completion, socket() shall return a non-negative
integer, the socket file descriptor."

The test in prepare_fds() however fails if socket fd is
zero (non-negative), which should be a valid value.

This was found while testing the SimpleLink socket offload driver,
which can return a zero-valued socket fd, per the POSIX spec.

Signed-off-by: default avatarGil Pitney <gil.pitney@linaro.org>
parent d67095ba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment