diff options
-rw-r--r-- | networking/nc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/networking/nc.c b/networking/nc.c index 0c843a686..8cb4b306e 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
@@ -24,7 +24,7 @@ | |||
24 | //config: Allow netcat to act as a server. | 24 | //config: Allow netcat to act as a server. |
25 | //config: | 25 | //config: |
26 | //config:config NC_EXTRA | 26 | //config:config NC_EXTRA |
27 | //config: bool "Netcat extensions (-eiw and filename)" | 27 | //config: bool "Netcat extensions (-eiw and -f FILE)" |
28 | //config: default y | 28 | //config: default y |
29 | //config: depends on NC | 29 | //config: depends on NC |
30 | //config: help | 30 | //config: help |
@@ -60,17 +60,18 @@ | |||
60 | //usage:#define nc_full_usage "\n\n" | 60 | //usage:#define nc_full_usage "\n\n" |
61 | //usage: "Open a pipe to IP:PORT" IF_NC_EXTRA(" or FILE") | 61 | //usage: "Open a pipe to IP:PORT" IF_NC_EXTRA(" or FILE") |
62 | //usage: NC_OPTIONS_STR | 62 | //usage: NC_OPTIONS_STR |
63 | //usage: IF_NC_EXTRA( | ||
64 | //usage: "\n -e PROG Run PROG after connect" | ||
65 | //usage: IF_NC_SERVER( | 63 | //usage: IF_NC_SERVER( |
66 | //usage: "\n -l Listen mode, for inbound connects" | 64 | //usage: "\n -l Listen mode, for inbound connects" |
67 | //usage: IF_NC_EXTRA( | 65 | //usage: IF_NC_EXTRA( |
68 | //usage: "\n (use -l twice with -e for persistent server)") | 66 | //usage: "\n (use -ll with -e for persistent server)" |
67 | //usage: ) | ||
69 | //usage: "\n -p PORT Local port" | 68 | //usage: "\n -p PORT Local port" |
70 | //usage: ) | 69 | //usage: ) |
71 | //usage: "\n -w SEC Timeout for connect" | 70 | //usage: IF_NC_EXTRA( |
71 | //usage: "\n -w SEC Connect timeout" | ||
72 | //usage: "\n -i SEC Delay interval for lines sent" | 72 | //usage: "\n -i SEC Delay interval for lines sent" |
73 | //usage: "\n -f FILE Use file (ala /dev/ttyS0) instead of network" | 73 | //usage: "\n -f FILE Use file (ala /dev/ttyS0) instead of network" |
74 | //usage: "\n -e PROG Run PROG after connect" | ||
74 | //usage: ) | 75 | //usage: ) |
75 | //usage: | 76 | //usage: |
76 | //usage:#define nc_notes_usage "" | 77 | //usage:#define nc_notes_usage "" |
@@ -147,7 +148,7 @@ int nc_main(int argc, char **argv) | |||
147 | *p++ = argv[optind++]; | 148 | *p++ = argv[optind++]; |
148 | } | 149 | } |
149 | ) | 150 | ) |
150 | /* optind points to argv[arvc] (NULL) now. | 151 | /* optind points to argv[argc] (NULL) now. |
151 | ** FIXME: we assume that getopt will not count options | 152 | ** FIXME: we assume that getopt will not count options |
152 | ** possibly present on "-e PROG ARGS" and will not | 153 | ** possibly present on "-e PROG ARGS" and will not |
153 | ** include them into final value of optind | 154 | ** include them into final value of optind |
@@ -226,10 +227,9 @@ int nc_main(int argc, char **argv) | |||
226 | /* child, or main thread if only one -l */ | 227 | /* child, or main thread if only one -l */ |
227 | xmove_fd(cfd, 0); | 228 | xmove_fd(cfd, 0); |
228 | xdup2(0, 1); | 229 | xdup2(0, 1); |
229 | xdup2(0, 2); | 230 | /*xdup2(0, 2); - original nc 1.10 does this, we don't */ |
230 | IF_NC_EXTRA(BB_EXECVP(execparam[0], execparam);) | 231 | IF_NC_EXTRA(BB_EXECVP(execparam[0], execparam);) |
231 | /* Don't print stuff or it will go over the wire... */ | 232 | bb_perror_msg_and_die("can't execute '%s'", execparam[0]); |
232 | _exit(127); | ||
233 | } | 233 | } |
234 | 234 | ||
235 | /* Select loop copying stdin to cfd, and cfd to stdout */ | 235 | /* Select loop copying stdin to cfd, and cfd to stdout */ |