From patchwork Wed Jan 4 21:32:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9497861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F8E3606A9 for ; Wed, 4 Jan 2017 21:34:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7993C282E2 for ; Wed, 4 Jan 2017 21:34:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D2B028339; Wed, 4 Jan 2017 21:34:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 006CE282E2 for ; Wed, 4 Jan 2017 21:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752315AbdADVeZ (ORCPT ); Wed, 4 Jan 2017 16:34:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:39238 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbdADVdE (ORCPT ); Wed, 4 Jan 2017 16:33:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 64317AAC4; Wed, 4 Jan 2017 21:32:53 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Thu, 05 Jan 2017 08:32:46 +1100 Subject: [nfs-utils PATCH] nfsstats: fix some exit codes. User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-suse-linux-gnu) cc: linux-nfs@vger.kernel.org Message-ID: <87zij6lddt.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP "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 --- 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; } }