diff options
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/devfsd.c | 4 | ||||
-rw-r--r-- | miscutils/hdparm.c | 2 | ||||
-rw-r--r-- | miscutils/i2c_tools.c | 2 | ||||
-rw-r--r-- | miscutils/less.c | 22 | ||||
-rw-r--r-- | miscutils/watchdog.c | 2 |
5 files changed, 18 insertions, 14 deletions
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index e5bb8a2d8..839d00fd0 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c | |||
@@ -453,7 +453,7 @@ int devfsd_main(int argc, char **argv) | |||
453 | DEVFSD_PROTOCOL_REVISION_DAEMON, bb_msg_proto_rev, proto_rev); | 453 | DEVFSD_PROTOCOL_REVISION_DAEMON, bb_msg_proto_rev, proto_rev); |
454 | if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) | 454 | if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) |
455 | bb_error_msg_and_die("%s mismatch!", bb_msg_proto_rev); | 455 | bb_error_msg_and_die("%s mismatch!", bb_msg_proto_rev); |
456 | exit(EXIT_SUCCESS); /* -v */ | 456 | exit_SUCCESS(); /* -v */ |
457 | } | 457 | } |
458 | /* Tell kernel we are special(i.e. we get to see hidden entries) */ | 458 | /* Tell kernel we are special(i.e. we get to see hidden entries) */ |
459 | xioctl(fd, DEVFSDIOC_SET_EVENT_MASK, 0); | 459 | xioctl(fd, DEVFSDIOC_SET_EVENT_MASK, 0); |
@@ -474,7 +474,7 @@ int devfsd_main(int argc, char **argv) | |||
474 | dir_operation(SERVICE, mount_point, 0, NULL); | 474 | dir_operation(SERVICE, mount_point, 0, NULL); |
475 | 475 | ||
476 | if (ENABLE_DEVFSD_FG_NP && no_polling) | 476 | if (ENABLE_DEVFSD_FG_NP && no_polling) |
477 | exit(EXIT_SUCCESS); | 477 | exit_SUCCESS(); |
478 | 478 | ||
479 | if (ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG) | 479 | if (ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG) |
480 | logmode = LOGMODE_BOTH; | 480 | logmode = LOGMODE_BOTH; |
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 01b4e8e2e..d8d8f6166 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c | |||
@@ -1271,7 +1271,7 @@ static void identify(uint16_t *val) | |||
1271 | } | 1271 | } |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | exit(EXIT_SUCCESS); | 1274 | exit_SUCCESS(); |
1275 | } | 1275 | } |
1276 | #endif | 1276 | #endif |
1277 | 1277 | ||
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index b25d49792..e3741eeba 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c | |||
@@ -1212,7 +1212,7 @@ static void NORETURN list_i2c_busses_and_exit(void) | |||
1212 | } | 1212 | } |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | exit(EXIT_SUCCESS); | 1215 | exit_SUCCESS(); |
1216 | } | 1216 | } |
1217 | 1217 | ||
1218 | static void NORETURN no_support(const char *cmd) | 1218 | static void NORETURN no_support(const char *cmd) |
diff --git a/miscutils/less.c b/miscutils/less.c index 063c4d378..6da991a0e 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
@@ -333,7 +333,7 @@ static void print_statusline(const char *str) | |||
333 | } | 333 | } |
334 | 334 | ||
335 | /* Exit the program gracefully */ | 335 | /* Exit the program gracefully */ |
336 | static void less_exit(int code) | 336 | static void restore_tty(void) |
337 | { | 337 | { |
338 | set_tty_cooked(); | 338 | set_tty_cooked(); |
339 | if (!(G.kbd_fd_orig_flags & O_NONBLOCK)) | 339 | if (!(G.kbd_fd_orig_flags & O_NONBLOCK)) |
@@ -343,9 +343,12 @@ static void less_exit(int code) | |||
343 | #else | 343 | #else |
344 | printf(ESC"[?1049l"); | 344 | printf(ESC"[?1049l"); |
345 | #endif | 345 | #endif |
346 | if (code < 0) | 346 | } |
347 | kill_myself_with_sig(- code); /* does not return */ | 347 | |
348 | exit(code); | 348 | static NOINLINE void less_exit(void) |
349 | { | ||
350 | restore_tty(); | ||
351 | exit_SUCCESS(); | ||
349 | } | 352 | } |
350 | 353 | ||
351 | #if (ENABLE_FEATURE_LESS_DASHCMD && ENABLE_FEATURE_LESS_LINENUMS) \ | 354 | #if (ENABLE_FEATURE_LESS_DASHCMD && ENABLE_FEATURE_LESS_LINENUMS) \ |
@@ -949,7 +952,7 @@ static void buffer_print(void) | |||
949 | ) { | 952 | ) { |
950 | i = option_mask32 & FLAG_F ? 0 : cur_fline; | 953 | i = option_mask32 & FLAG_F ? 0 : cur_fline; |
951 | if (max_fline - i <= max_displayed_line) | 954 | if (max_fline - i <= max_displayed_line) |
952 | less_exit(EXIT_SUCCESS); | 955 | less_exit(); |
953 | } | 956 | } |
954 | status_print(); | 957 | status_print(); |
955 | } | 958 | } |
@@ -1186,7 +1189,7 @@ static int64_t getch_nowait(void) | |||
1186 | goto again; | 1189 | goto again; |
1187 | } | 1190 | } |
1188 | /* EOF/error (ssh session got killed etc) */ | 1191 | /* EOF/error (ssh session got killed etc) */ |
1189 | less_exit(EXIT_SUCCESS); | 1192 | less_exit(); |
1190 | } | 1193 | } |
1191 | set_tty_cooked(); | 1194 | set_tty_cooked(); |
1192 | return key64; | 1195 | return key64; |
@@ -1377,7 +1380,7 @@ static void colon_process(void) | |||
1377 | change_file(-1); | 1380 | change_file(-1); |
1378 | break; | 1381 | break; |
1379 | case 'q': | 1382 | case 'q': |
1380 | less_exit(EXIT_SUCCESS); | 1383 | less_exit(); |
1381 | break; | 1384 | break; |
1382 | case 'x': | 1385 | case 'x': |
1383 | change_file(0); | 1386 | change_file(0); |
@@ -1795,7 +1798,7 @@ static void keypress_process(int keypress) | |||
1795 | buffer_line(cur_fline); | 1798 | buffer_line(cur_fline); |
1796 | break; | 1799 | break; |
1797 | case 'q': case 'Q': | 1800 | case 'q': case 'Q': |
1798 | less_exit(EXIT_SUCCESS); | 1801 | less_exit(); |
1799 | break; | 1802 | break; |
1800 | #if ENABLE_FEATURE_LESS_MARKS | 1803 | #if ENABLE_FEATURE_LESS_MARKS |
1801 | case 'm': | 1804 | case 'm': |
@@ -1874,7 +1877,8 @@ static void keypress_process(int keypress) | |||
1874 | #if !ENABLE_PLATFORM_MINGW32 | 1877 | #if !ENABLE_PLATFORM_MINGW32 |
1875 | static void sig_catcher(int sig) | 1878 | static void sig_catcher(int sig) |
1876 | { | 1879 | { |
1877 | less_exit(- sig); | 1880 | restore_tty(); |
1881 | kill_myself_with_sig(sig); /* does not return */ | ||
1878 | } | 1882 | } |
1879 | #endif | 1883 | #endif |
1880 | 1884 | ||
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index d8e9c78f5..9f5a4b849 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c | |||
@@ -76,7 +76,7 @@ static void shutdown_on_signal(int sig UNUSED_PARAM) | |||
76 | { | 76 | { |
77 | remove_pidfile_std_path_and_ext("watchdog"); | 77 | remove_pidfile_std_path_and_ext("watchdog"); |
78 | shutdown_watchdog(); | 78 | shutdown_watchdog(); |
79 | _exit(EXIT_SUCCESS); | 79 | _exit_SUCCESS(); |
80 | } | 80 | } |
81 | 81 | ||
82 | static void watchdog_open(const char* device) | 82 | static void watchdog_open(const char* device) |