0122-vmstat: getopt*() returns -1 when done, not EOF.
Luckily, EOF is usually -1, but this is not guaranteed by the standard. Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
parent
eaec2d0977
commit
e37e4528d0
2
vmstat.c
2
vmstat.c
@ -910,7 +910,7 @@ int main(int argc, char *argv[])
|
|||||||
atexit(close_stdout);
|
atexit(close_stdout);
|
||||||
|
|
||||||
while ((c =
|
while ((c =
|
||||||
getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts, NULL)) != EOF)
|
getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts, NULL)) != -1)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'V':
|
case 'V':
|
||||||
printf(PROCPS_NG_VERSION);
|
printf(PROCPS_NG_VERSION);
|
||||||
|
Loading…
Reference in New Issue
Block a user