From: Ruediger Meier Date: Tue, 27 Jun 2017 18:34:29 +0000 (+0200) Subject: tools: add segfault detection for checkusage.sh X-Git-Tag: v2.31-rc1~233^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66b7469960bc97c05a22498d11117ef2d60b54cd;p=thirdparty%2Futil-linux.git tools: add segfault detection for checkusage.sh Signed-off-by: Ruediger Meier --- diff --git a/tools/checkusage.sh b/tools/checkusage.sh index 6cde8fbf62..69d69fde1c 100755 --- a/tools/checkusage.sh +++ b/tools/checkusage.sh @@ -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"