- use EXIT_{SUCCESS,FAILURE}. No object-code changes

This commit is contained in:
Bernhard Reutner-Fischer
2008-05-19 09:29:47 +00:00
parent cb83abd7b6
commit 636a1f85e8
45 changed files with 85 additions and 85 deletions

View File

@@ -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 */

View File

@@ -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;
}
}

View File

@@ -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) {

View File

@@ -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 */

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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