* [nfs-utils PATCH] nfsstats: fix some exit codes.
@ 2017-01-04 21:32 NeilBrown
2017-01-11 16:09 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: NeilBrown @ 2017-01-04 21:32 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs
[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]
"nfsstat -m" always exits with "1" (unless there is an error opening
/proc/mounts). It should exist "0".
Also, a few usage errors cause an exit of "255" when it should probably
be "1".
Signed-off-by: NeilBrown <neilb@suse.com>
---
utils/nfsstat/nfsstat.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/utils/nfsstat/nfsstat.c b/utils/nfsstat/nfsstat.c
index 8376347d5af4..eddbe9a14f25 100644
--- a/utils/nfsstat/nfsstat.c
+++ b/utils/nfsstat/nfsstat.c
@@ -389,7 +389,7 @@ main(int argc, char **argv)
switch (c) {
case 'a':
fprintf(stderr, "nfsstat: nfs acls are not yet supported.\n");
- return -1;
+ return 1;
case 'c':
opt_clt = 1;
break;
@@ -455,7 +455,7 @@ main(int argc, char **argv)
"not yet supported\n");
return 2;
case 'm':
- return mounts(MOUNTSFILE);
+ return ! mounts(MOUNTSFILE);
case '\1':
usage(progname);
return 0;
@@ -464,7 +464,7 @@ main(int argc, char **argv)
return 0;
default:
printf("Try `%s --help' for more information.\n", progname);
- return -1;
+ return 1;
}
}
--
2.11.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [nfs-utils PATCH] nfsstats: fix some exit codes.
2017-01-04 21:32 [nfs-utils PATCH] nfsstats: fix some exit codes NeilBrown
@ 2017-01-11 16:09 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2017-01-11 16:09 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-nfs
On 01/04/2017 04:32 PM, NeilBrown wrote:
> "nfsstat -m" always exits with "1" (unless there is an error opening
> /proc/mounts). It should exist "0".
>
> Also, a few usage errors cause an exit of "255" when it should probably
> be "1".
>
> Signed-off-by: NeilBrown <neilb@suse.com>
Committed....
steved.
> ---
> utils/nfsstat/nfsstat.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/utils/nfsstat/nfsstat.c b/utils/nfsstat/nfsstat.c
> index 8376347d5af4..eddbe9a14f25 100644
> --- a/utils/nfsstat/nfsstat.c
> +++ b/utils/nfsstat/nfsstat.c
> @@ -389,7 +389,7 @@ main(int argc, char **argv)
> switch (c) {
> case 'a':
> fprintf(stderr, "nfsstat: nfs acls are not yet supported.\n");
> - return -1;
> + return 1;
> case 'c':
> opt_clt = 1;
> break;
> @@ -455,7 +455,7 @@ main(int argc, char **argv)
> "not yet supported\n");
> return 2;
> case 'm':
> - return mounts(MOUNTSFILE);
> + return ! mounts(MOUNTSFILE);
> case '\1':
> usage(progname);
> return 0;
> @@ -464,7 +464,7 @@ main(int argc, char **argv)
> return 0;
> default:
> printf("Try `%s --help' for more information.\n", progname);
> - return -1;
> + return 1;
> }
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-11 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04 21:32 [nfs-utils PATCH] nfsstats: fix some exit codes NeilBrown
2017-01-11 16:09 ` Steve Dickson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.