summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenys Vlasenko2023-06-15 11:55:56 +0200
committerDenys Vlasenko2023-06-15 11:55:56 +0200
commit648f506949ded749e28186d0092b6e42085c897b (patch)
tree049c72bc8149f41fc617d00f7d32f1d6384f8e2f /loginutils
parent61a4959251667751e424e600c6cb75de39d6b1c3 (diff)
downloadbusybox-648f506949ded749e28186d0092b6e42085c897b.zip
busybox-648f506949ded749e28186d0092b6e42085c897b.tar.gz
libbb: code shrink: introduce and use [_]exit_FAILURE()
function old new delta exit_FAILURE - 7 +7 _exit_FAILURE - 7 +7 run 198 199 +1 restore_state_and_exit 114 115 +1 xbsd_write_bootstrap 399 397 -2 vfork_compressor 209 207 -2 sig_handler 12 10 -2 serial_ctl 154 152 -2 parse_args 1169 1167 -2 onintr 21 19 -2 make_new_session 493 491 -2 login_main 988 986 -2 gotsig 35 33 -2 do_iplink 1315 1313 -2 addgroup_main 397 395 -2 inetd_main 1911 1908 -3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/12 up/down: 16/-25) Total: -9 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/addgroup.c2
-rw-r--r--loginutils/login.c10
2 files changed, 6 insertions, 6 deletions
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';