1303 files changed, 32187 insertions, 57138 deletions
diff --git a/networking/nc.c b/networking/nc.c index 6105db1..50302d8 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -6,9 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -#include "libbb.h" - //config:config NC //config: bool "nc" //config: default y @@ -42,6 +39,12 @@ //config: -s ADDR, -n, -u, -v, -o FILE, -z options, but loses //config: busybox-specific extensions: -f FILE. +//applet:IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_NC) += nc.o + +#include "libbb.h" +#include "common_bufsiz.h" #if ENABLE_NC_110_COMPAT # include "nc_bloaty.c" #else @@ -238,6 +241,8 @@ int nc_main(int argc, char **argv) FD_SET(cfd, &readfds); FD_SET(STDIN_FILENO, &readfds); +#define iobuf bb_common_bufsiz1 + setup_common_bufsiz(); for (;;) { int fd; int ofd; @@ -248,11 +253,10 @@ int nc_main(int argc, char **argv) if (select(cfd + 1, &testfds, NULL, NULL, NULL) < 0) bb_perror_msg_and_die("select"); -#define iobuf bb_common_bufsiz1 fd = STDIN_FILENO; while (1) { if (FD_ISSET(fd, &testfds)) { - nread = safe_read(fd, iobuf, sizeof(iobuf)); + nread = safe_read(fd, iobuf, COMMON_BUFSIZE); if (fd == cfd) { if (nread < 1) exit(EXIT_SUCCESS); |