9
0
Fork 0

net/ifup.c: don't fail silently

Since commit a162dfe503 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>
This commit is contained in:
Juergen Borleis 2014-04-23 12:56:53 +02:00 committed by Sascha Hauer
parent 0af79fbb67
commit 4428de2aad
1 changed files with 6 additions and 2 deletions

View File

@ -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);