From 9440270c25553cccf941d838cd9b58ca28729741 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 24 Mar 2018 20:26:56 +0000 Subject: timeout: return exit code 125 if option parsing fails --- coreutils/timeout.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) #endif const char *opt_s = "TERM"; +#if ENABLE_PLATFORM_MINGW32 + xfunc_error_retval = 125; +#endif + /* -p option is not documented, it is needed to support NOMMU. */ /* -t SECONDS; -p PARENT_PID */ @@ -132,7 +136,6 @@ int timeout_main(int argc UNUSED_PARAM, char **argv) #endif BB_EXECVP_or_die(argv); #else /* ENABLE_PLATFORM_MINGW32 */ - xfunc_error_retval = 125; if (signo != SIGTERM && signo != SIGKILL && signo != 0) bb_error_msg_and_die("unknown signal '%s'", opt_s); -- cgit v1.2.3-55-g6feb