sandbox: eth-raw: Correct valid socket test in send/recv
authorJoe Hershberger <joe.hershberger@ni.com>
Mon, 2 Jul 2018 19:47:44 +0000 (14:47 -0500)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 26 Jul 2018 19:08:17 +0000 (14:08 -0500)
commit97367df109b845d0bd93eef3f507d259668e8843
treed70132b7f3f5f1ceff96ba72be6f3eab583b7046
parent82a115fdec875d7e8dc601fe0e1b12859814c91c
sandbox: eth-raw: Correct valid socket test in send/recv

In open, the socket is correctly checked to be -1 in the error case.
In send and recv, we checked for 0, but that is a valid socket number.

Correct this by checking for -1 as a bad socket everywhere.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/eth-raw-os.c