linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: NeilBrown <neilb@suse.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [nfs-utils PATCH] nfsstats: fix some exit codes.
Date: Wed, 11 Jan 2017 11:09:51 -0500	[thread overview]
Message-ID: <55ad3197-ab8f-06e0-02d5-03de1adc65bd@RedHat.com> (raw)
In-Reply-To: <87zij6lddt.fsf@notabene.neil.brown.name>



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;
>  		}
>  	}
>  


      reply	other threads:[~2017-01-11 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 21:32 [nfs-utils PATCH] nfsstats: fix some exit codes NeilBrown
2017-01-11 16:09 ` Steve Dickson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55ad3197-ab8f-06e0-02d5-03de1adc65bd@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).