diff options
author | Juergen Borleis <jbe@pengutronix.de> | 2014-04-23 12:56:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-04-24 09:03:31 +0200 |
commit | 4428de2aad9a540e1375da0e8818534f0648e489 (patch) | |
tree | bf60904cdff3d7c0e82866f74084a1f63e64275d /net/ifup.c | |
parent | 0af79fbb6779921d3f1962773adb7fb57d3c89d4 (diff) | |
download | barebox-4428de2aad9a540e1375da0e8818534f0648e489.tar.gz barebox-4428de2aad9a540e1375da0e8818534f0648e489.tar.xz |
net/ifup.c: don't fail silently
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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/ifup.c')
-rw-r--r-- | net/ifup.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ifup.c b/net/ifup.c index 7b63136296..b259a975dc 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' failed with %d\n", cmd, ret); goto out; + } ret = stat(cmd_discover, &s); if (!ret) { ret = run_command(cmd_discover); - if (ret) + if (ret) { + pr_err("Running '%s' failed with %d\n", cmd, ret); goto out; + } } dev = get_device_by_name(name); |