summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2008-05-19 09:29:47 +0000
committerBernhard Reutner-Fischer2008-05-19 09:29:47 +0000
commit636a1f85e89432601c59cdc3239fc867b4adf051 (patch)
treed43c9ca120c29bf2d4567b1bb0674c6a8bae2b6d /networking
parentcb83abd7b6b052224c1f3b998e863aac76914afd (diff)
downloadbusybox-636a1f85e89432601c59cdc3239fc867b4adf051.zip
busybox-636a1f85e89432601c59cdc3239fc867b4adf051.tar.gz
- use EXIT_{SUCCESS,FAILURE}. No object-code changes
Diffstat (limited to 'networking')
-rw-r--r--networking/inetd.c10
-rw-r--r--networking/libiproute/iptunnel.c2
-rw-r--r--networking/nc.c2
-rw-r--r--networking/ping.c2
-rw-r--r--networking/slattach.c6
-rw-r--r--networking/telnet.c8
-rw-r--r--networking/telnetd.c6
7 files changed, 18 insertions, 18 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index 3be9dcb..08c0995 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1124,7 +1124,7 @@ static void clean_up_and_exit(int sig ATTRIBUTE_UNUSED)
close(sep->se_fd);
}
remove_pidfile(_PATH_INETDPID);
- exit(0);
+ exit(EXIT_SUCCESS);
}
int inetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -1344,7 +1344,7 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv)
else
sep->se_builtin->bi_dgram_fn(ctrl, sep);
if (pid) /* we did vfork */
- _exit(1);
+ _exit(EXIT_FAILURE);
maybe_close(accepted_fd);
continue; /* -> check next fd in fd set */
}
@@ -1408,7 +1408,7 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv)
/* eat packet in udp case */
if (sep->se_socktype != SOCK_STREAM)
recv(0, line, LINE_SIZE, MSG_DONTWAIT);
- _exit(1);
+ _exit(EXIT_FAILURE);
} /* for (sep = servtab...) */
} /* for (;;) */
}
@@ -1441,7 +1441,7 @@ static void echo_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
close(STDERR_FILENO);
xopen("/dev/null", O_WRONLY);
BB_EXECVP("cat", (char**)cat_args);
- /* on failure we return to main, which does exit(1) */
+ /* on failure we return to main, which does exit(EXIT_FAILURE) */
#endif
}
static void echo_dg(int s, servtab_t *sep)
@@ -1479,7 +1479,7 @@ static void discard_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
/* no error messages please... */
xdup2(STDOUT_FILENO, STDERR_FILENO);
BB_EXECVP("cat", (char**)cat_args);
- /* on failure we return to main, which does exit(1) */
+ /* on failure we return to main, which does exit(EXIT_FAILURE) */
#endif
}
/* ARGSUSED */
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index 1190b68..752d812 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)
struct ip_tunnel_parm old_p;
memset(&old_p, 0, sizeof(old_p));
if (do_get_ioctl(*argv, &old_p))
- exit(1);
+ exit(EXIT_FAILURE);
*p = old_p;
}
}
diff --git a/networking/nc.c b/networking/nc.c
index 7d4a6e0..27c58a8 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -183,7 +183,7 @@ int nc_main(int argc, char **argv)
nread = safe_read(fd, iobuf, sizeof(iobuf));
if (fd == cfd) {
if (nread < 1)
- exit(0);
+ exit(EXIT_SUCCESS);
ofd = STDOUT_FILENO;
} else {
if (nread<1) {
diff --git a/networking/ping.c b/networking/ping.c
index c3a7107..3ac9481 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -755,7 +755,7 @@ int ping_main(int argc ATTRIBUTE_UNUSED, char **argv)
dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa);
ping(lsa);
- print_stats_and_exit(0);
+ print_stats_and_exit(EXIT_SUCCESS);
/*return EXIT_SUCCESS;*/
}
#endif /* FEATURE_FANCY_PING */
diff --git a/networking/slattach.c b/networking/slattach.c
index 3ffbb3b..96dec7e 100644
--- a/networking/slattach.c
+++ b/networking/slattach.c
@@ -110,13 +110,13 @@ static void set_state(struct termios *state, int encap)
/* Set encapsulation (SLIP, CSLIP, etc) */
if (ioctl_or_warn(handle, SIOCSIFENCAP, &encap) < 0) {
bad:
- restore_state_and_exit(1);
+ restore_state_and_exit(EXIT_FAILURE);
}
}
static void sig_handler(int signo ATTRIBUTE_UNUSED)
{
- restore_state_and_exit(0);
+ restore_state_and_exit(EXIT_SUCCESS);
}
int slattach_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -239,5 +239,5 @@ int slattach_main(int argc ATTRIBUTE_UNUSED, char **argv)
system(extcmd);
/* Restore states and exit */
- restore_state_and_exit(0);
+ restore_state_and_exit(EXIT_SUCCESS);
}
diff --git a/networking/telnet.c b/networking/telnet.c
index 32e9993..b357e69 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -122,7 +122,7 @@ static void conescape(void)
" e exit telnet\r\n");
if (read(0, &b, 1) <= 0)
- doexit(1);
+ doexit(EXIT_FAILURE);
switch (b) {
case 'l':
@@ -143,7 +143,7 @@ static void conescape(void)
rawmode();
break;
case 'e':
- doexit(0);
+ doexit(EXIT_SUCCESS);
}
write_str(1, "continuing...\r\n");
@@ -634,7 +634,7 @@ int telnet_main(int argc, char **argv)
{
len = read(0, G.buf, DATABUFSIZE);
if (len <= 0)
- doexit(0);
+ doexit(EXIT_SUCCESS);
TRACE(0, ("Read con: %d\n", len));
handlenetoutput(len);
}
@@ -648,7 +648,7 @@ int telnet_main(int argc, char **argv)
len = read(G.netfd, G.buf, DATABUFSIZE);
if (len <= 0) {
write_str(1, "Connection closed by foreign host\r\n");
- doexit(1);
+ doexit(EXIT_FAILURE);
}
TRACE(0, ("Read netfd (%d): %d\n", G.netfd, len));
handlenetinput(len);
diff --git a/networking/telnetd.c b/networking/telnetd.c
index e312c0b..3660d78 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -262,7 +262,7 @@ make_new_session(
BB_EXECVP(loginpath, (char **)login_argv);
/* _exit is safer with vfork, and we shouldn't send message
* to remote clients anyway */
- _exit(1); /*bb_perror_msg_and_die("execv %s", loginpath);*/
+ _exit(EXIT_FAILURE); /*bb_perror_msg_and_die("execv %s", loginpath);*/
}
/* Must match getopt32 string */
@@ -281,7 +281,7 @@ free_session(struct tsession *ts)
struct tsession *t = sessions;
if (option_mask32 & OPT_INETD)
- exit(0);
+ exit(EXIT_SUCCESS);
/* Unlink this telnet session from the session list */
if (t == ts)
@@ -325,7 +325,7 @@ free_session(struct tsession *ts)
#else /* !FEATURE_TELNETD_STANDALONE */
-/* Used in main() only, thus "return 0" actually is exit(0). */
+/* Used in main() only, thus "return 0" actually is exit(EXIT_SUCCESS). */
#define free_session(ts) return 0
#endif