From: Phil Sutter Date: Thu, 15 Oct 2015 19:01:16 +0000 (+0200) Subject: ss: return -1 if an unrecognized option was given X-Git-Tag: v4.3.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f73105ab42795422f131fb711712e3c860df982f;p=thirdparty%2Fiproute2.git ss: return -1 if an unrecognized option was given When getopt_long encounters an option which has not been registered, it returns '?'. React upon that and call usage() instead of help() so ss returns with a non-zero exit status. Signed-off-by: Phil Sutter --- diff --git a/misc/ss.c b/misc/ss.c index eca4aa35f..a9ae85ec5 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -3770,8 +3770,8 @@ int main(int argc, char *argv[]) exit(1); break; case 'h': - case '?': help(); + case '?': default: usage(); }