sulogin: use bb_error_msg instead of bb_info_msg; better message
[oweals/busybox.git] / networking / nc_bloaty.c
index 04baf0316124fce720610a4696b6c41145090be8..471ae1a12f69ce904a900ceb189cd9ac38328340 100644 (file)
@@ -175,9 +175,9 @@ enum {
        OPT_w = (1 << 5),
        OPT_l = (1 << 6) * ENABLE_NC_SERVER,
        OPT_k = (1 << 7) * ENABLE_NC_SERVER,
-       OPT_i = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
-       OPT_o = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
-       OPT_z = (1 << (9+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+       OPT_i = (1 << (6+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+       OPT_o = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+       OPT_z = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
 };
 
 #define o_nflag   (option_mask32 & OPT_n)
@@ -613,7 +613,6 @@ static int readwrite(void)
        while (fds_open) {
                unsigned wretry = 8200;               /* net-write sanity counter */
 
-               errno = 0;                            /* clear from sleep, close, whatever */
                ding2 = ding1;                        /* FD_COPY ain't portable... */
        /* some systems, notably linux, crap into their select timers on return, so
         we create a expendable copy and give *that* to select.  */
@@ -696,9 +695,9 @@ Debug("got %d from the net, errno %d", rr, errno);
                        if (rr > 0) {
                                if (o_ofile) /* log the stdout */
                                        oprint('<', (unsigned char *)np, rr);
-                               np += rr;                        /* fix up ptrs and whatnot */
+                               np += rr;
                                rnleft -= rr;
-                               wrote_out += rr;                /* global count */
+                               wrote_out += rr; /* global count */
                        }
 Debug("wrote %d to stdout, errno %d", rr, errno);
                } /* rnleft */
@@ -713,7 +712,7 @@ Debug("wrote %d to stdout, errno %d", rr, errno);
                                        oprint('>', (unsigned char *)zp, rr);
                                zp += rr;
                                rzleft -= rr;
-                               wrote_net += rr;                /* global count */
+                               wrote_net += rr; /* global count */
                        }
 Debug("wrote %d to net, errno %d", rr, errno);
                } /* rzleft */
@@ -730,7 +729,7 @@ Debug("wrote %d to net, errno %d", rr, errno);
                        }
                        goto shovel;
                }
-       } /* while ding1:netfd is open */
+       } /* while (fds_open) */
 
        /* XXX: maybe want a more graceful shutdown() here, or screw around with
         linger times??  I suspect that I don't need to since I'm always doing
@@ -864,8 +863,8 @@ int nc_main(int argc UNUSED_PARAM, char **argv)
                xbind(netfd, &ouraddr->u.sa, ouraddr->len);
        }
 #if 0
-       setsockopt(netfd, SOL_SOCKET, SO_RCVBUF, &o_rcvbuf, sizeof o_rcvbuf);
-       setsockopt(netfd, SOL_SOCKET, SO_SNDBUF, &o_sndbuf, sizeof o_sndbuf);
+       setsockopt_SOL_SOCKET_int(netfd, SO_RCVBUF, o_rcvbuf);
+       setsockopt_SOL_SOCKET_int(netfd, SO_SNDBUF, o_sndbuf);
 #endif
 
 #ifdef BLOAT