]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tools: add segfault detection for checkusage.sh
authorRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 27 Jun 2017 18:34:29 +0000 (20:34 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 29 Jun 2017 12:04:29 +0000 (14:04 +0200)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tools/checkusage.sh

index 6cde8fbf62a43f74b4a8c36e441a0dc52e378792..69d69fde1c814a9bd5e3f413bf8b0d2bc27f7adc 100755 (executable)
@@ -61,8 +61,8 @@ function exec_option {
        # hardcoded ... nologin should always return false
        if test "$cmdb" = "nologin" &&
                        test "$opt" = "--help" -o "$opt" = "--version"; then
-               if test "$ret" = "0"; then
-                       echo "$cmdb, $opt, should return false"
+               if test "$ret" -eq 0 -o "$ret" -ge 128; then
+                       echo "$cmdb, $opt, should return false: $ret"
                fi
                ret=0
        fi
@@ -123,6 +123,8 @@ function check_unknownopt {
 
        if test $ret = 0; then
                echo "$cb: $opt, returns no error"
+       elif test $ret -ge 128; then
+               echo "$cb: $opt, abnormal exit: $ret"
        fi
        if test -n "$out"; then
                echo "$cb: $opt, non-empty stdout"