summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--applets/individual.c2
-rw-r--r--archival/tar.c2
-rw-r--r--console-tools/resize.c2
-rw-r--r--findutils/xargs.c2
-rw-r--r--include/libbb.h2
-rw-r--r--init/init.c2
-rw-r--r--libbb/xfuncs.c10
-rw-r--r--loginutils/addgroup.c2
-rw-r--r--loginutils/login.c10
-rw-r--r--miscutils/devfsd.c6
-rw-r--r--miscutils/setserial.c2
-rw-r--r--networking/inetd.c4
-rw-r--r--networking/libiproute/iplink.c2
-rw-r--r--networking/libiproute/iptunnel.c2
-rw-r--r--networking/ping.c2
-rw-r--r--networking/slattach.c2
-rw-r--r--networking/telnetd.c2
-rw-r--r--procps/powertop.c2
-rw-r--r--selinux/setfiles.c2
-rw-r--r--util-linux/fdisk_osf.c5
-rw-r--r--util-linux/more.c2
21 files changed, 40 insertions, 27 deletions
diff --git a/applets/individual.c b/applets/individual.c
index e94f26c..2f743d9 100644
--- a/applets/individual.c
+++ b/applets/individual.c
@@ -20,5 +20,5 @@ int main(int argc, char **argv)
void bb_show_usage(void)
{
fputs_stdout(APPLET_full_usage "\n");
- exit(EXIT_FAILURE);
+ exit_FAILURE();
}
diff --git a/archival/tar.c b/archival/tar.c
index 9de3759..d6ca6c1 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -621,7 +621,7 @@ static void NOINLINE vfork_compressor(int tar_fd, const char *gzip)
execlp(gzip, gzip, "-f", (char *)0);
vfork_exec_errno = errno;
- _exit(EXIT_FAILURE);
+ _exit_FAILURE();
}
/* parent */
diff --git a/console-tools/resize.c b/console-tools/resize.c
index 056e337..95e0c7b 100644
--- a/console-tools/resize.c
+++ b/console-tools/resize.c
@@ -45,7 +45,7 @@ static void
onintr(int sig UNUSED_PARAM)
{
tcsetattr(STDERR_FILENO, TCSANOW, old_termios_p);
- _exit(EXIT_FAILURE);
+ _exit_FAILURE();
}
int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 067ef41..c6000e0 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -800,7 +800,7 @@ void bb_show_usage(void)
{
fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n",
applet_name);
- exit(EXIT_FAILURE);
+ exit_FAILURE();
}
int main(int argc, char **argv)
diff --git a/include/libbb.h b/include/libbb.h
index 6191deb..18336da 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1281,6 +1281,8 @@ void set_task_comm(const char *comm) FAST_FUNC;
#endif
void exit_SUCCESS(void) NORETURN FAST_FUNC;
void _exit_SUCCESS(void) NORETURN FAST_FUNC;
+void exit_FAILURE(void) NORETURN FAST_FUNC;
+void _exit_FAILURE(void) NORETURN FAST_FUNC;
/* Helpers for daemonization.
*
diff --git a/init/init.c b/init/init.c
index 1e1ce83..2ee1e4c 100644
--- a/init/init.c
+++ b/init/init.c
@@ -500,7 +500,7 @@ static pid_t run(const struct init_action *a)
/* Open the new terminal device */
if (!open_stdio_to_tty(a->terminal))
- _exit(EXIT_FAILURE);
+ _exit_FAILURE();
/* NB: on NOMMU we can't wait for input in child, so
* "askfirst" will work the same as "respawn". */
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 465e536..b03af85 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -433,3 +433,13 @@ void FAST_FUNC _exit_SUCCESS(void)
{
_exit(EXIT_SUCCESS);
}
+
+void FAST_FUNC exit_FAILURE(void)
+{
+ exit(EXIT_FAILURE);
+}
+
+void FAST_FUNC _exit_FAILURE(void)
+{
+ _exit(EXIT_FAILURE);
+}
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index 2a83c8a..71d3a8d 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -102,7 +102,7 @@ static void new_group(char *group, gid_t gid)
/* add entry to group */
p = xasprintf("x:%u:", (unsigned) gr.gr_gid);
if (update_passwd(bb_path_group_file, group, p, NULL) < 0)
- exit(EXIT_FAILURE);
+ exit_FAILURE();
if (ENABLE_FEATURE_CLEAN_UP)
free(p);
#if ENABLE_FEATURE_SHADOWPASSWDS
diff --git a/loginutils/login.c b/loginutils/login.c
index 3322381..b02be21 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -173,7 +173,7 @@ static void die_if_nologin(void)
fflush_all();
/* Users say that they do need this prior to exit: */
tcdrain(STDOUT_FILENO);
- exit(EXIT_FAILURE);
+ exit_FAILURE();
}
#else
# define die_if_nologin() ((void)0)
@@ -265,19 +265,19 @@ static void get_username_or_die(char *buf, int size_buf)
do {
c = getchar();
if (c == EOF)
- exit(EXIT_FAILURE);
+ exit_FAILURE();
if (c == '\n') {
if (!--cntdown)
- exit(EXIT_FAILURE);
+ exit_FAILURE();
goto prompt;
}
} while (isspace(c)); /* maybe isblank? */
*buf++ = c;
if (!fgets(buf, size_buf-2, stdin))
- exit(EXIT_FAILURE);
+ exit_FAILURE();
if (!strchr(buf, '\n'))
- exit(EXIT_FAILURE);
+ exit_FAILURE();
while ((unsigned char)*buf > ' ')
buf++;
*buf = '\0';
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c
index 297693f..36b4915 100644
--- a/miscutils/devfsd.c
+++ b/miscutils/devfsd.c
@@ -354,10 +354,10 @@ static const char bb_msg_variable_not_found[] ALIGN1 = "variable: %s not found";
#define simple_info_logger(p, msg)
#define msg_logger(p, fmt, args...)
#define simple_msg_logger(p, msg)
-#define msg_logger_and_die(p, fmt, args...) exit(EXIT_FAILURE)
-#define simple_msg_logger_and_die(p, msg) exit(EXIT_FAILURE)
+#define msg_logger_and_die(p, fmt, args...) exit_FAILURE()
+#define simple_msg_logger_and_die(p, msg) exit_FAILURE()
#define error_logger(p, fmt, args...)
-#define error_logger_and_die(p, fmt, args...) exit(EXIT_FAILURE)
+#define error_logger_and_die(p, fmt, args...) exit_FAILURE()
#endif
static void safe_memcpy(char *dest, const char *src, int len)
diff --git a/miscutils/setserial.c b/miscutils/setserial.c
index 2006861..175c788 100644
--- a/miscutils/setserial.c
+++ b/miscutils/setserial.c
@@ -535,7 +535,7 @@ static int serial_ctl(int fd, int ops, struct serial_struct *serinfo)
bb_simple_perror_msg(err);
if (ops & CTL_NODIE)
goto nodie;
- exit(EXIT_FAILURE);
+ exit_FAILURE();
}
static void print_flag(const char **prefix, const char *flag)
diff --git a/networking/inetd.c b/networking/inetd.c
index fb2fbe3..e63edcd 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1449,7 +1449,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
else
sep->se_builtin->bi_dgram_fn(ctrl, sep);
if (pid) /* we did fork */
- _exit(EXIT_FAILURE);
+ _exit_FAILURE();
maybe_close(accepted_fd);
continue; /* -> check next fd in fd set */
}
@@ -1530,7 +1530,7 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
/* eat packet in udp case */
if (sep->se_socktype != SOCK_STREAM)
recv(0, line, LINE_SIZE, MSG_DONTWAIT);
- _exit(EXIT_FAILURE);
+ _exit_FAILURE();
} /* for (sep = servtab...) */
} /* for (;;) */
}
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index 68d1990..9eb0b4f 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -215,7 +215,7 @@ static void parse_address(char *dev, int hatype, int halen, char *lla, struct if
alen = hatype == 1/*ARPHRD_ETHER*/ ? 14/*ETH_HLEN*/ : 19/*INFINIBAND_HLEN*/;
alen = ll_addr_a2n((unsigned char *)(ifr->ifr_hwaddr.sa_data), alen, lla);
if (alen < 0)
- exit(EXIT_FAILURE);
+ exit_FAILURE();
if (alen != halen) {
bb_error_msg_and_die("wrong address (%s) length: expected %d bytes", lla, halen);
}
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index c9fa632..1ec81c6 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -319,7 +319,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(EXIT_FAILURE);
+ exit_FAILURE();
*p = old_p;
}
}
diff --git a/networking/ping.c b/networking/ping.c
index 9805695..b7e6955 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -247,7 +247,7 @@ struct globals {
static void noresp(int ign UNUSED_PARAM)
{
printf("No response from %s\n", G.hostname);
- exit(EXIT_FAILURE);
+ exit_FAILURE();
}
static void ping4(len_and_sockaddr *lsa)
diff --git a/networking/slattach.c b/networking/slattach.c
index 6d2a252..16b4c91 100644
--- a/networking/slattach.c
+++ b/networking/slattach.c
@@ -80,7 +80,7 @@ static void restore_state_and_exit(int exitcode)
/* Restore line status */
if (tcsetattr_serial_or_warn(&G.saved_state))
- exit(EXIT_FAILURE);
+ exit_FAILURE();
if (ENABLE_FEATURE_CLEAN_UP)
close(serial_fd);
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 0805e46..fb90e7f 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -571,7 +571,7 @@ make_new_session(
BB_EXECVP(G.loginpath, (char **)login_argv);
/* _exit is safer with vfork, and we shouldn't send message
* to remote clients anyway */
- _exit(EXIT_FAILURE); /*bb_perror_msg_and_die("execv %s", G.loginpath);*/
+ _exit_FAILURE(); /*bb_perror_msg_and_die("execv %s", G.loginpath);*/
}
#if ENABLE_FEATURE_TELNETD_STANDALONE
diff --git a/procps/powertop.c b/procps/powertop.c
index 18ddaa3..8d5d929 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -109,7 +109,7 @@ static void reset_term(void)
static void sig_handler(int signo UNUSED_PARAM)
{
reset_term();
- _exit(EXIT_FAILURE);
+ _exit_FAILURE();
}
#endif
diff --git a/selinux/setfiles.c b/selinux/setfiles.c
index a617b95..70e68a6 100644
--- a/selinux/setfiles.c
+++ b/selinux/setfiles.c
@@ -687,7 +687,7 @@ int setfiles_main(int argc UNUSED_PARAM, char **argv)
bb_simple_perror_msg_and_die(argv[0]);
}
if (nerr)
- exit(EXIT_FAILURE);
+ exit_FAILURE();
argv++;
}
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c
index 6c66c13..049f0b1 100644
--- a/util-linux/fdisk_osf.c
+++ b/util-linux/fdisk_osf.c
@@ -746,11 +746,12 @@ xbsd_write_bootstrap(void)
return;
e = d + sizeof(struct xbsd_disklabel);
- for (p = d; p < e; p++)
+ for (p = d; p < e; p++) {
if (*p) {
printf("Bootstrap overlaps with disk label!\n");
- exit(EXIT_FAILURE);
+ exit_FAILURE();
}
+ }
memmove(d, &dl, sizeof(struct xbsd_disklabel));
diff --git a/util-linux/more.c b/util-linux/more.c
index a830dcb..352a3b6 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -65,7 +65,7 @@ static void gotsig(int sig UNUSED_PARAM)
* therefore it is safe in signal handler */
bb_putchar_stderr('\n');
tcsetattr_tty_TCSANOW(&G.initial_settings);
- _exit(EXIT_FAILURE);
+ _exit_FAILURE();
}
#define CONVERTED_TAB_SIZE 8