space <= 0 check avoids unsigned comparison botch
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Mon, 25 Jan 1982 10:33:15 +0000 (02:33 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Mon, 25 Jan 1982 10:33:15 +0000 (02:33 -0800)
SCCS-vsn: sys/kern/uipc_socket.c 4.30

usr/src/sys/kern/uipc_socket.c

index 0da3549..ba8fec9 100644 (file)
@@ -1,4 +1,4 @@
-/*     uipc_socket.c   4.29    82/01/19        */
+/*     uipc_socket.c   4.30    82/01/24        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -303,7 +303,7 @@ again:
                goto release;
        }
        space = sbspace(&so->so_snd);
                goto release;
        }
        space = sbspace(&so->so_snd);
-       if (space == 0 || sosendallatonce(so) && space < u.u_count) {
+       if (space <= 0 || sosendallatonce(so) && space < u.u_count) {
                if (so->so_options & SO_NONBLOCKING)
                        snderr(EWOULDBLOCK);
                sbunlock(&so->so_snd);
                if (so->so_options & SO_NONBLOCKING)
                        snderr(EWOULDBLOCK);
                sbunlock(&so->so_snd);