From 6188685091c58c9772b990cf0ca6ac522f97a9d0 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Sun, 13 May 2012 12:43:58 +0200 Subject: Make errno a positive value Normally errno contains a positive error value. A certain unnamed developer mixed this up while implementing U-Boot-v2. Also, normally errno is never set to zero by any library function. This patch fixes this. Signed-off-by: Sascha Hauer --- common/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/env.c') diff --git a/common/env.c b/common/env.c index e57a520a35..a01a27e24f 100644 --- a/common/env.c +++ b/common/env.c @@ -219,7 +219,7 @@ int setenv(const char *_name, const char *value) else ret = -ENODEV; - errno = ret; + errno = -ret; if (ret < 0) perror("set parameter"); -- cgit v1.2.3