diff options
Diffstat (limited to 'networking')
-rw-r--r-- | networking/inetd.c | 10 | ||||
-rw-r--r-- | networking/libiproute/iptunnel.c | 2 | ||||
-rw-r--r-- | networking/nc.c | 2 | ||||
-rw-r--r-- | networking/ping.c | 2 | ||||
-rw-r--r-- | networking/slattach.c | 6 | ||||
-rw-r--r-- | networking/telnet.c | 8 | ||||
-rw-r--r-- | networking/telnetd.c | 6 |
7 files changed, 18 insertions, 18 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index 3be9dcb7f..08c09953b 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -1124,7 +1124,7 @@ static void clean_up_and_exit(int sig ATTRIBUTE_UNUSED) | |||
1124 | close(sep->se_fd); | 1124 | close(sep->se_fd); |
1125 | } | 1125 | } |
1126 | remove_pidfile(_PATH_INETDPID); | 1126 | remove_pidfile(_PATH_INETDPID); |
1127 | exit(0); | 1127 | exit(EXIT_SUCCESS); |
1128 | } | 1128 | } |
1129 | 1129 | ||
1130 | int inetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 1130 | int inetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
@@ -1344,7 +1344,7 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
1344 | else | 1344 | else |
1345 | sep->se_builtin->bi_dgram_fn(ctrl, sep); | 1345 | sep->se_builtin->bi_dgram_fn(ctrl, sep); |
1346 | if (pid) /* we did vfork */ | 1346 | if (pid) /* we did vfork */ |
1347 | _exit(1); | 1347 | _exit(EXIT_FAILURE); |
1348 | maybe_close(accepted_fd); | 1348 | maybe_close(accepted_fd); |
1349 | continue; /* -> check next fd in fd set */ | 1349 | continue; /* -> check next fd in fd set */ |
1350 | } | 1350 | } |
@@ -1408,7 +1408,7 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
1408 | /* eat packet in udp case */ | 1408 | /* eat packet in udp case */ |
1409 | if (sep->se_socktype != SOCK_STREAM) | 1409 | if (sep->se_socktype != SOCK_STREAM) |
1410 | recv(0, line, LINE_SIZE, MSG_DONTWAIT); | 1410 | recv(0, line, LINE_SIZE, MSG_DONTWAIT); |
1411 | _exit(1); | 1411 | _exit(EXIT_FAILURE); |
1412 | } /* for (sep = servtab...) */ | 1412 | } /* for (sep = servtab...) */ |
1413 | } /* for (;;) */ | 1413 | } /* for (;;) */ |
1414 | } | 1414 | } |
@@ -1441,7 +1441,7 @@ static void echo_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED) | |||
1441 | close(STDERR_FILENO); | 1441 | close(STDERR_FILENO); |
1442 | xopen("/dev/null", O_WRONLY); | 1442 | xopen("/dev/null", O_WRONLY); |
1443 | BB_EXECVP("cat", (char**)cat_args); | 1443 | BB_EXECVP("cat", (char**)cat_args); |
1444 | /* on failure we return to main, which does exit(1) */ | 1444 | /* on failure we return to main, which does exit(EXIT_FAILURE) */ |
1445 | #endif | 1445 | #endif |
1446 | } | 1446 | } |
1447 | static void echo_dg(int s, servtab_t *sep) | 1447 | static void echo_dg(int s, servtab_t *sep) |
@@ -1479,7 +1479,7 @@ static void discard_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED) | |||
1479 | /* no error messages please... */ | 1479 | /* no error messages please... */ |
1480 | xdup2(STDOUT_FILENO, STDERR_FILENO); | 1480 | xdup2(STDOUT_FILENO, STDERR_FILENO); |
1481 | BB_EXECVP("cat", (char**)cat_args); | 1481 | BB_EXECVP("cat", (char**)cat_args); |
1482 | /* on failure we return to main, which does exit(1) */ | 1482 | /* on failure we return to main, which does exit(EXIT_FAILURE) */ |
1483 | #endif | 1483 | #endif |
1484 | } | 1484 | } |
1485 | /* ARGSUSED */ | 1485 | /* ARGSUSED */ |
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index 1190b6867..752d81264 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c | |||
@@ -284,7 +284,7 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p) | |||
284 | struct ip_tunnel_parm old_p; | 284 | struct ip_tunnel_parm old_p; |
285 | memset(&old_p, 0, sizeof(old_p)); | 285 | memset(&old_p, 0, sizeof(old_p)); |
286 | if (do_get_ioctl(*argv, &old_p)) | 286 | if (do_get_ioctl(*argv, &old_p)) |
287 | exit(1); | 287 | exit(EXIT_FAILURE); |
288 | *p = old_p; | 288 | *p = old_p; |
289 | } | 289 | } |
290 | } | 290 | } |
diff --git a/networking/nc.c b/networking/nc.c index 7d4a6e047..27c58a8c8 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
@@ -183,7 +183,7 @@ int nc_main(int argc, char **argv) | |||
183 | nread = safe_read(fd, iobuf, sizeof(iobuf)); | 183 | nread = safe_read(fd, iobuf, sizeof(iobuf)); |
184 | if (fd == cfd) { | 184 | if (fd == cfd) { |
185 | if (nread < 1) | 185 | if (nread < 1) |
186 | exit(0); | 186 | exit(EXIT_SUCCESS); |
187 | ofd = STDOUT_FILENO; | 187 | ofd = STDOUT_FILENO; |
188 | } else { | 188 | } else { |
189 | if (nread<1) { | 189 | if (nread<1) { |
diff --git a/networking/ping.c b/networking/ping.c index c3a71071c..3ac9481c8 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -755,7 +755,7 @@ int ping_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
755 | 755 | ||
756 | dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); | 756 | dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); |
757 | ping(lsa); | 757 | ping(lsa); |
758 | print_stats_and_exit(0); | 758 | print_stats_and_exit(EXIT_SUCCESS); |
759 | /*return EXIT_SUCCESS;*/ | 759 | /*return EXIT_SUCCESS;*/ |
760 | } | 760 | } |
761 | #endif /* FEATURE_FANCY_PING */ | 761 | #endif /* FEATURE_FANCY_PING */ |
diff --git a/networking/slattach.c b/networking/slattach.c index 3ffbb3ba8..96dec7e5f 100644 --- a/networking/slattach.c +++ b/networking/slattach.c | |||
@@ -110,13 +110,13 @@ static void set_state(struct termios *state, int encap) | |||
110 | /* Set encapsulation (SLIP, CSLIP, etc) */ | 110 | /* Set encapsulation (SLIP, CSLIP, etc) */ |
111 | if (ioctl_or_warn(handle, SIOCSIFENCAP, &encap) < 0) { | 111 | if (ioctl_or_warn(handle, SIOCSIFENCAP, &encap) < 0) { |
112 | bad: | 112 | bad: |
113 | restore_state_and_exit(1); | 113 | restore_state_and_exit(EXIT_FAILURE); |
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | static void sig_handler(int signo ATTRIBUTE_UNUSED) | 117 | static void sig_handler(int signo ATTRIBUTE_UNUSED) |
118 | { | 118 | { |
119 | restore_state_and_exit(0); | 119 | restore_state_and_exit(EXIT_SUCCESS); |
120 | } | 120 | } |
121 | 121 | ||
122 | int slattach_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 122 | int slattach_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
@@ -239,5 +239,5 @@ int slattach_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
239 | system(extcmd); | 239 | system(extcmd); |
240 | 240 | ||
241 | /* Restore states and exit */ | 241 | /* Restore states and exit */ |
242 | restore_state_and_exit(0); | 242 | restore_state_and_exit(EXIT_SUCCESS); |
243 | } | 243 | } |
diff --git a/networking/telnet.c b/networking/telnet.c index 32e9993d3..b357e690c 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
@@ -122,7 +122,7 @@ static void conescape(void) | |||
122 | " e exit telnet\r\n"); | 122 | " e exit telnet\r\n"); |
123 | 123 | ||
124 | if (read(0, &b, 1) <= 0) | 124 | if (read(0, &b, 1) <= 0) |
125 | doexit(1); | 125 | doexit(EXIT_FAILURE); |
126 | 126 | ||
127 | switch (b) { | 127 | switch (b) { |
128 | case 'l': | 128 | case 'l': |
@@ -143,7 +143,7 @@ static void conescape(void) | |||
143 | rawmode(); | 143 | rawmode(); |
144 | break; | 144 | break; |
145 | case 'e': | 145 | case 'e': |
146 | doexit(0); | 146 | doexit(EXIT_SUCCESS); |
147 | } | 147 | } |
148 | 148 | ||
149 | write_str(1, "continuing...\r\n"); | 149 | write_str(1, "continuing...\r\n"); |
@@ -634,7 +634,7 @@ int telnet_main(int argc, char **argv) | |||
634 | { | 634 | { |
635 | len = read(0, G.buf, DATABUFSIZE); | 635 | len = read(0, G.buf, DATABUFSIZE); |
636 | if (len <= 0) | 636 | if (len <= 0) |
637 | doexit(0); | 637 | doexit(EXIT_SUCCESS); |
638 | TRACE(0, ("Read con: %d\n", len)); | 638 | TRACE(0, ("Read con: %d\n", len)); |
639 | handlenetoutput(len); | 639 | handlenetoutput(len); |
640 | } | 640 | } |
@@ -648,7 +648,7 @@ int telnet_main(int argc, char **argv) | |||
648 | len = read(G.netfd, G.buf, DATABUFSIZE); | 648 | len = read(G.netfd, G.buf, DATABUFSIZE); |
649 | if (len <= 0) { | 649 | if (len <= 0) { |
650 | write_str(1, "Connection closed by foreign host\r\n"); | 650 | write_str(1, "Connection closed by foreign host\r\n"); |
651 | doexit(1); | 651 | doexit(EXIT_FAILURE); |
652 | } | 652 | } |
653 | TRACE(0, ("Read netfd (%d): %d\n", G.netfd, len)); | 653 | TRACE(0, ("Read netfd (%d): %d\n", G.netfd, len)); |
654 | handlenetinput(len); | 654 | handlenetinput(len); |
diff --git a/networking/telnetd.c b/networking/telnetd.c index e312c0b41..3660d788f 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -262,7 +262,7 @@ make_new_session( | |||
262 | BB_EXECVP(loginpath, (char **)login_argv); | 262 | BB_EXECVP(loginpath, (char **)login_argv); |
263 | /* _exit is safer with vfork, and we shouldn't send message | 263 | /* _exit is safer with vfork, and we shouldn't send message |
264 | * to remote clients anyway */ | 264 | * to remote clients anyway */ |
265 | _exit(1); /*bb_perror_msg_and_die("execv %s", loginpath);*/ | 265 | _exit(EXIT_FAILURE); /*bb_perror_msg_and_die("execv %s", loginpath);*/ |
266 | } | 266 | } |
267 | 267 | ||
268 | /* Must match getopt32 string */ | 268 | /* Must match getopt32 string */ |
@@ -281,7 +281,7 @@ free_session(struct tsession *ts) | |||
281 | struct tsession *t = sessions; | 281 | struct tsession *t = sessions; |
282 | 282 | ||
283 | if (option_mask32 & OPT_INETD) | 283 | if (option_mask32 & OPT_INETD) |
284 | exit(0); | 284 | exit(EXIT_SUCCESS); |
285 | 285 | ||
286 | /* Unlink this telnet session from the session list */ | 286 | /* Unlink this telnet session from the session list */ |
287 | if (t == ts) | 287 | if (t == ts) |
@@ -325,7 +325,7 @@ free_session(struct tsession *ts) | |||
325 | 325 | ||
326 | #else /* !FEATURE_TELNETD_STANDALONE */ | 326 | #else /* !FEATURE_TELNETD_STANDALONE */ |
327 | 327 | ||
328 | /* Used in main() only, thus "return 0" actually is exit(0). */ | 328 | /* Used in main() only, thus "return 0" actually is exit(EXIT_SUCCESS). */ |
329 | #define free_session(ts) return 0 | 329 | #define free_session(ts) return 0 |
330 | 330 | ||
331 | #endif | 331 | #endif |