Bump version to 1.32.0
[oweals/busybox.git] / networking / nc_bloaty.c
index 3db7849824b92cff13ef4bb6430965ec5f56a050..034e03d21f6c67c50110716af4d52eb3e9637f73 100644 (file)
@@ -198,8 +198,8 @@ enum {
 #define Debug(...) do { } while (0)
 #endif
 
-#define holler_error(...)  do { if (o_verbose) bb_error_msg(__VA_ARGS__); } while (0)
-#define holler_perror(...) do { if (o_verbose) bb_perror_msg(__VA_ARGS__); } while (0)
+#define holler_error(msg)  do { if (o_verbose) bb_simple_error_msg(msg); } while (0)
+#define holler_perror(msg) do { if (o_verbose) bb_simple_perror_msg(msg); } while (0)
 
 /* catch: no-brainer interrupt handler */
 static void catch(int sig)
@@ -361,10 +361,10 @@ static void dolisten(int is_persistent, char **proggie)
                        rr = recv_from_to(netfd, NULL, 0, MSG_PEEK, /*was bigbuf_net, BIGSIZ*/
                                &remend.u.sa, &ouraddr->u.sa, ouraddr->len);
                        if (rr < 0)
-                               bb_perror_msg_and_die("recvfrom");
+                               bb_simple_perror_msg_and_die("recvfrom");
                        unarm();
                } else
-                       bb_error_msg_and_die("timeout");
+                       bb_simple_error_msg_and_die("timeout");
 /* Now we learned *to which IP* peer has connected, and we want to anchor
 our socket on it, so that our outbound packets will have correct local IP.
 Unfortunately, bind() on already bound socket will fail now (EINVAL):
@@ -382,7 +382,7 @@ create new one, and bind() it. TODO */
                        remend.len = LSA_SIZEOF_SA;
                        rr = accept(netfd, &remend.u.sa, &remend.len);
                        if (rr < 0)
-                               bb_perror_msg_and_die("accept");
+                               bb_simple_perror_msg_and_die("accept");
                        if (themaddr) {
                                int sv_port, port, r;
 
@@ -409,7 +409,7 @@ create new one, and bind() it. TODO */
                        }
                        unarm();
                } else
-                       bb_error_msg_and_die("timeout");
+                       bb_simple_error_msg_and_die("timeout");
 
                if (is_persistent && proggie) {
                        /* -l -k -e PROG */
@@ -494,7 +494,7 @@ static int udptest(void)
 
        rr = write(netfd, bigbuf_in, 1);
        if (rr != 1)
-               bb_perror_msg("udptest first write");
+               bb_simple_perror_msg("udptest first write");
 
        if (o_wait)
                sleep(o_wait); // can be interrupted! while (t) nanosleep(&t)?
@@ -644,7 +644,7 @@ static int readwrite(void)
                        if (rr <= 0) {
                                if (rr < 0 && o_verbose > 1) {
                                        /* nc 1.10 doesn't do this */
-                                       bb_perror_msg("net read");
+                                       bb_simple_perror_msg("net read");
                                }
                                pfds[1].fd = -1;                   /* don't poll for netfd anymore */
                                fds_open--;
@@ -787,11 +787,15 @@ int nc_main(int argc UNUSED_PARAM, char **argv)
  e_found:
 
        // -g -G -t -r deleted, unimplemented -a deleted too
-       opt_complementary = "?2:vv:ll"; /* max 2 params; -v and -l are counters; -w N */
-       getopt32(argv, "np:s:uvw:+" IF_NC_SERVER("lk")
-                       IF_NC_EXTRA("i:o:z"),
-                       &str_p, &str_s, &o_wait
-                       IF_NC_EXTRA(, &str_i, &str_o), &o_verbose IF_NC_SERVER(, &cnt_l));
+       getopt32(argv, "^"
+               "np:s:uvw:+"/* -w N */ IF_NC_SERVER("lk")
+               IF_NC_EXTRA("i:o:z")
+                       "\0"
+                       "?2:vv"IF_NC_SERVER(":ll"), /* max 2 params; -v and -l are counters */
+               &str_p, &str_s, &o_wait
+               IF_NC_EXTRA(, &str_i, &str_o)
+                       , &o_verbose IF_NC_SERVER(, &cnt_l)
+       );
        argv += optind;
 #if ENABLE_NC_EXTRA
        if (option_mask32 & OPT_i) /* line-interval time */
@@ -865,7 +869,7 @@ int nc_main(int argc UNUSED_PARAM, char **argv)
                /* apparently UDP can listen ON "port 0",
                 but that's not useful */
                if (!o_lport)
-                       bb_error_msg_and_die("UDP listen needs nonzero -p port");
+                       bb_simple_error_msg_and_die("UDP listen needs nonzero -p port");
        }
 #endif