]> granicus.if.org Git - procps-ng/commit
top: ensure an EXIT_FAILURE with bad command line args
authorJim Warner <james.warner@comcast.net>
Thu, 2 Mar 2023 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@dropbear.xyz>
Wed, 8 Mar 2023 11:18:39 +0000 (22:18 +1100)
commitcbbe8fe324bfc9f59d7dda1e0518c442a90d8462
tree75b9d3ff8acd6a4f64abc2cfad8104564a09646b
parentcced1e49ef25eae20773342a23af1e0d3dd27d30
top: ensure an EXIT_FAILURE with bad command line args

When getopt usage was added (plus long options) in the
patch shown below, top no longer returned EXIT_FAILURE
when the error message was generated by getopt itself.

This commit will restore the proper behavior no matter
who might issue a command line argument error message.

Thanks to Bastian Bittorf for discovering this buglet.

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/273
. sep, 2021 - getopt with long form args
commit c91b371485b7ffaea3a7c669b080328d141dfb6b

Signed-off-by: Jim Warner <james.warner@comcast.net>
src/top/top.c