diff mbox

[1/4] util/envlist: Properly forward a callback's error in envlist_parse.

Message ID 1366902405-19117-1-git-send-email-thomas@codesourcery.com
State New
Headers show

Commit Message

Thomas Schwinge April 25, 2013, 3:06 p.m. UTC
Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
---
 util/envlist.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git util/envlist.c util/envlist.c
index ebc06cf..cbbf7e5 100644
--- util/envlist.c
+++ util/envlist.c
@@ -109,9 +109,10 @@  envlist_parse(envlist_t *envlist, const char *env,
 
 	envvar = strtok_r(tmpenv, ",", &envsave);
 	while (envvar != NULL) {
-		if ((*callback)(envlist, envvar) != 0) {
+		int err;
+		if ((err = (*callback)(envlist, envvar)) != 0) {
 			free(tmpenv);
-			return (errno);
+			return (err);
 		}
 		envvar = strtok_r(NULL, ",", &envsave);
 	}