diff options
author | Ron Yorston <rmy@pobox.com> | 2018-03-24 20:26:56 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-03-24 20:26:56 +0000 |
commit | 9440270c25553cccf941d838cd9b58ca28729741 (patch) | |
tree | fb4d99b6183e37352b7454ce7d3c787587a337ab | |
parent | 7f0a48f231c7a1bfcfce8b585abc54a3c48d3297 (diff) | |
download | busybox-w32-9440270c25553cccf941d838cd9b58ca28729741.tar.gz busybox-w32-9440270c25553cccf941d838cd9b58ca28729741.tar.bz2 busybox-w32-9440270c25553cccf941d838cd9b58ca28729741.zip |
timeout: return exit code 125 if option parsing fails
-rw-r--r-- | coreutils/timeout.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/coreutils/timeout.c b/coreutils/timeout.c index ecdf1633c..297d08d16 100644 --- a/coreutils/timeout.c +++ b/coreutils/timeout.c | |||
@@ -65,6 +65,10 @@ int timeout_main(int argc UNUSED_PARAM, char **argv) | |||
65 | #endif | 65 | #endif |
66 | const char *opt_s = "TERM"; | 66 | const char *opt_s = "TERM"; |
67 | 67 | ||
68 | #if ENABLE_PLATFORM_MINGW32 | ||
69 | xfunc_error_retval = 125; | ||
70 | #endif | ||
71 | |||
68 | /* -p option is not documented, it is needed to support NOMMU. */ | 72 | /* -p option is not documented, it is needed to support NOMMU. */ |
69 | 73 | ||
70 | /* -t SECONDS; -p PARENT_PID */ | 74 | /* -t SECONDS; -p PARENT_PID */ |
@@ -132,7 +136,6 @@ int timeout_main(int argc UNUSED_PARAM, char **argv) | |||
132 | #endif | 136 | #endif |
133 | BB_EXECVP_or_die(argv); | 137 | BB_EXECVP_or_die(argv); |
134 | #else /* ENABLE_PLATFORM_MINGW32 */ | 138 | #else /* ENABLE_PLATFORM_MINGW32 */ |
135 | xfunc_error_retval = 125; | ||
136 | if (signo != SIGTERM && signo != SIGKILL && signo != 0) | 139 | if (signo != SIGTERM && signo != SIGKILL && signo != 0) |
137 | bb_error_msg_and_die("unknown signal '%s'", opt_s); | 140 | bb_error_msg_and_die("unknown signal '%s'", opt_s); |
138 | 141 | ||