aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2015-10-15 21:01:16 +0200
committerStephen Hemminger <shemming@brocade.com>2015-10-18 21:56:55 -0700
commitf73105ab42795422f131fb711712e3c860df982f (patch)
treee08783a2bbc91a27a55cdc0c31bc169c19087fad
parent6f07f3dc41545657c0364eb17850b946f41861bf (diff)
downloadandroid_external_iproute2-f73105ab42795422f131fb711712e3c860df982f.tar.gz
android_external_iproute2-f73105ab42795422f131fb711712e3c860df982f.tar.bz2
android_external_iproute2-f73105ab42795422f131fb711712e3c860df982f.zip
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 <phil@nwl.cc>
-rw-r--r--misc/ss.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/ss.c b/misc/ss.c
index eca4aa3..a9ae85e 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();
}