check syscall returns against < 0 instead of == -1
commit9f30805bc4ff65ad4ca0be9dfb26b1a9bdc70c51
authorEric Wong <normalperson@yhbt.net>
Fri, 16 Aug 2013 01:52:15 +0000 (16 01:52 +0000)
committerEric Wong <normalperson@yhbt.net>
Fri, 16 Aug 2013 01:57:04 +0000 (16 01:57 +0000)
treec974cbd69173710607707545817b66883c5b650f
parent8be51237720fd18cb45188f29c717bbac0ca1964
check syscall returns against < 0 instead of == -1

This may help us avoid errors in case of C library bugs,
and also results in smaller code:

$ ~/linux/scripts/bloat-o-meter before.so after.so
add/remove: 0/0 grow/shrink: 0/9 up/down: 0/-66 (-66)
function                                     old     new   delta
s_trywrite                                   160     159      -1
kgio_write                                   160     159      -1
kgio_trywrite                                160     159      -1
my_recv                                      616     610      -6
my_peek                                      616     610      -6
stream_connect                               456     448      -8
my_socket                                    222     213      -9
my_writev                                   1703    1687     -16
write_check                                  427     409     -18
ext/kgio/accept.c
ext/kgio/connect.c
ext/kgio/nonblock.h
ext/kgio/read_write.c
ext/kgio/tryopen.c