*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
-
-#include "libbb.h"
-
//config:config NC
//config: bool "nc"
//config: default y
//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
FD_SET(cfd, &readfds);
FD_SET(STDIN_FILENO, &readfds);
+#define iobuf bb_common_bufsiz1
+ setup_common_bufsiz();
for (;;) {
int fd;
int ofd;
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);