From: Ben Hutchings <ben@decadent.org.uk>
To: Sridhar Samudrala <sridhar.samudrala@intel.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ethtool: return 1 as exit code on a settings(-s) failure.
Date: Thu, 16 Apr 2015 22:11:59 +0100 [thread overview]
Message-ID: <1429218719.3211.119.camel@decadent.org.uk> (raw)
In-Reply-To: <1429217709-21625-1-git-send-email-sridhar.samudrala@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]
On Thu, 2015-04-16 at 13:55 -0700, Sridhar Samudrala wrote:
> Currently 0 is returned on both success or failure.
Previously discussed here:
<http://thread.gmane.org/gmane.linux.network/349717>.
Ben.
> Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
> ---
> ethtool.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ethtool.c b/ethtool.c
> index 01b13a6..163dff2 100644
> --- a/ethtool.c
> +++ b/ethtool.c
> @@ -2352,7 +2352,7 @@ static int do_sset(struct cmd_context *ctx)
> int argc = ctx->argc;
> char **argp = ctx->argp;
> int i;
> - int err;
> + int err = 0;
>
> for (i = 0; i < ARRAY_SIZE(flags_msglvl); i++)
> flag_to_cmdline_info(flags_msglvl[i].name,
> @@ -2665,7 +2665,7 @@ static int do_sset(struct cmd_context *ctx)
> }
> }
>
> - return 0;
> + return err ? 1 : 0;
> }
>
> static int do_gregs(struct cmd_context *ctx)
--
Ben Hutchings
Humour is the best antidote to reality.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
prev parent reply other threads:[~2015-04-16 21:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-16 20:55 [PATCH] ethtool: return 1 as exit code on a settings(-s) failure Sridhar Samudrala
2015-04-16 21:11 ` Ben Hutchings [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=1429218719.3211.119.camel@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=netdev@vger.kernel.org \
--cc=sridhar.samudrala@intel.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