#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)
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):
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;
}
unarm();
} else
- bb_error_msg_and_die("timeout");
+ bb_simple_error_msg_and_die("timeout");
if (is_persistent && proggie) {
/* -l -k -e PROG */
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)?
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--;
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 */
/* 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