mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Juergen Borleis <jbe@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] net/ifup.c: don't fail silently
Date: Wed, 23 Apr 2014 12:30:42 +0200	[thread overview]
Message-ID: <20140423103042.GR5858@pengutronix.de> (raw)
In-Reply-To: <1398244766-5843-2-git-send-email-jbe@pengutronix.de>

On Wed, Apr 23, 2014 at 11:19:24AM +0200, Juergen Borleis wrote:
> Since commit a162dfe50345d3461010759f8a0e79f7e388c140 the ifup command is implemented in C and runs up to two external scripts.
> If one of these scripts return with an error code, the command terminates silently. This can confuse a user because there is
> no hint about the reason why it fails. Add error messages to avoid this case.
> 
> Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
> ---
>  net/ifup.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ifup.c b/net/ifup.c
> index 7b63136..c74120c 100644
> --- a/net/ifup.c
> +++ b/net/ifup.c
> @@ -70,14 +70,18 @@ int ifup(const char *name, unsigned flags)
>  	cmd_discover = asprintf("/env/network/%s-discover", name);
>  
>  	ret = run_command(cmd);
> -	if (ret)
> +	if (ret) {
> +		pr_err("Running '%s' fails\n", cmd);

It failed, not it fails. Also, please print the error code along with
the message.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-04-23 10:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23  9:19 Fix some ifup related network issues Juergen Borleis
2014-04-23  9:19 ` [PATCH 1/3] net/ifup.c: don't fail silently Juergen Borleis
2014-04-23 10:30   ` Sascha Hauer [this message]
2014-04-23 10:56     ` Juergen Borleis
2014-04-23  9:19 ` [PATCH 2/3] net/ifup.c: avoid setting the MAC twice Juergen Borleis
2014-04-23  9:19 ` [PATCH 3/3] default environment: force a specific return value Juergen Borleis
2014-04-24  7:04 ` Fix some ifup related network issues Sascha Hauer

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=20140423103042.GR5858@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jbe@pengutronix.de \
    /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