aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2017-08-30 16:57:45 +0100
committerRon Yorston <rmy@pobox.com>2017-08-30 17:09:57 +0100
commit0599746d9bcf513c4898cbd1a46ef1d5b3478627 (patch)
treee9e64f90efef836b22b404bbe351032cd14a8050 /networking
parent002f3c9ea19a1cd68294d905f566be5b615a9bef (diff)
downloadbusybox-w32-0599746d9bcf513c4898cbd1a46ef1d5b3478627.tar.gz
busybox-w32-0599746d9bcf513c4898cbd1a46ef1d5b3478627.tar.bz2
busybox-w32-0599746d9bcf513c4898cbd1a46ef1d5b3478627.zip
win32: make vfork fail at compile-time
Nothing in busybox-w32 uses fork. Remove the implementations of fork, vfork and xvfork so that, for example, enabling cpio pass-through causes an error at compile-time, not run-time. MinGW-w64 defines pid_t, so we don't have to. Ensure code containing xvfork in netcat is disabled when NC_EXTRA is disabled. Otherwise removing the implementation of vfork costs 64 bytes.
Diffstat (limited to 'networking')
-rw-r--r--networking/nc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/networking/nc.c b/networking/nc.c
index df073d7df..3437c565e 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -198,7 +198,7 @@ int nc_main(int argc, char **argv)
198 } 198 }
199#endif 199#endif
200 close_on_exec_on(sfd); 200 close_on_exec_on(sfd);
201 accept_again: 201 IF_NC_EXTRA(accept_again:)
202 cfd = accept(sfd, NULL, 0); 202 cfd = accept(sfd, NULL, 0);
203 if (cfd < 0) 203 if (cfd < 0)
204 bb_perror_msg_and_die("accept"); 204 bb_perror_msg_and_die("accept");
@@ -216,6 +216,7 @@ int nc_main(int argc, char **argv)
216 /*signal(SIGALRM, SIG_DFL);*/ 216 /*signal(SIGALRM, SIG_DFL);*/
217 } 217 }
218 218
219#if ENABLE_NC_EXTRA
219 /* -e given? */ 220 /* -e given? */
220 if (execparam) { 221 if (execparam) {
221 pid_t pid; 222 pid_t pid;
@@ -234,6 +235,7 @@ int nc_main(int argc, char **argv)
234 IF_NC_EXTRA(BB_EXECVP(execparam[0], execparam);) 235 IF_NC_EXTRA(BB_EXECVP(execparam[0], execparam);)
235 IF_NC_EXTRA(bb_perror_msg_and_die("can't execute '%s'", execparam[0]);) 236 IF_NC_EXTRA(bb_perror_msg_and_die("can't execute '%s'", execparam[0]);)
236 } 237 }
238#endif
237 239
238 /* Select loop copying stdin to cfd, and cfd to stdout */ 240 /* Select loop copying stdin to cfd, and cfd to stdout */
239 241