[PATCH] common: env: make error message more verbose

Steffen Trumtrar s.trumtrar at pengutronix.de
Tue Apr 28 03:32:27 PDT 2015


Change the setenv error message from

	set parameter: Invalid argument

to a more helpful

	net: cannot set parameter 'nameserver': Invalid argument

Signed-off-by: Steffen Trumtrar <s.trumtrar at pengutronix.de>
---
 common/env.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/env.c b/common/env.c
index 2e33eb35856b..434170a7468b 100644
--- a/common/env.c
+++ b/common/env.c
@@ -225,8 +225,10 @@ int setenv(const char *_name, const char *value)
 
 		errno = -ret;
 
-		if (ret < 0)
-			perror("set parameter");
+		if (ret < 0) {
+			dev_err(dev, "cannot set parameter '%s'", par);
+			perror("");
+		}
 
 		goto out;
 	}
-- 
2.1.4




More information about the barebox mailing list