Commit f73105ab authored by Phil Sutter's avatar Phil Sutter Committed by Stephen Hemminger

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: default avatarPhil Sutter <phil@nwl.cc>
parent 6f07f3dc
......@@ -3770,8 +3770,8 @@ int main(int argc, char *argv[])
exit(1);
break;
case 'h':
case '?':
help();
case '?':
default:
usage();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment