coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] runcon: distinguish runcon specific errors in exit status


From: Pádraig Brady
Subject: Re: [PATCH] runcon: distinguish runcon specific errors in exit status
Date: Sat, 27 Aug 2022 19:22:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Thunderbird/98.0

On 27/08/2022 17:59, Pádraig Brady wrote:
* src/runcon.c: Use EXIT_CANCELED (125) instead of EXIT_FAILURE (1),
so that errors specific to runcon can be distinguished,
from those of the invoked program.
* doc/coreutils.texi (runcon invocation): Fix the Exit status
description to say we return 125 (not 127) for internal errors.
* tests/misc/runcon-no-reorder.sh: Add a test case.

Followed up with this test adjustment:

diff --git a/tests/misc/invalid-opt.pl b/tests/misc/invalid-opt.pl
index 76fa04644..22a0b4121 100755
--- a/tests/misc/invalid-opt.pl
+++ b/tests/misc/invalid-opt.pl
@@ -34,6 +34,7 @@ my %exit_status =
     expr => 0,
     nice => 125,
     nohup => 125,
+    runcon => 125,
     sort => 2,
     stdbuf => 125,
     test => 0,
diff --git a/tests/misc/usage_vs_getopt.sh b/tests/misc/usage_vs_getopt.sh
index a489accb2..59e9b093e 100755
--- a/tests/misc/usage_vs_getopt.sh
+++ b/tests/misc/usage_vs_getopt.sh
@@ -26,7 +26,7 @@ checkprg () {
   rcexp=1
   case "$prg" in
     dir | ls | printenv | sort | tty | vdir ) rcexp=2 ;;
-    env | chroot | nice | nohup | stdbuf | timeout ) rcexp=125 ;;
+    env | chroot | nice | nohup | runcon | stdbuf | timeout ) rcexp=125 ;;
   esac
   # Write the pattern for a long, unknown option into a pattern file.
   o='thisoptiondoesnotexist'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]