From f3c83363200fd335f37119cb1d238b0e47fd4299 Mon Sep 17 00:00:00 2001 From: Dawid Gajownik Date: Sun, 9 Aug 2015 12:50:40 -0300 Subject: [PATCH] weston-launch: On error putenv returns a non-zero value According to POSIX standard "upon successful completion, putenv() shall return 0; otherwise, it shall return a non-zero value." Unlike in setenv() we should not be checking only for negative values. Signed-off-by: Dawid Gajownik --- src/weston-launch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/weston-launch.c b/src/weston-launch.c index 90a070fb..b8dfb17a 100644 --- a/src/weston-launch.c +++ b/src/weston-launch.c @@ -603,7 +603,7 @@ setup_session(struct weston_launch *wl) env = pam_getenvlist(wl->ph); if (env) { for (i = 0; env[i]; ++i) { - if (putenv(env[i]) < 0) + if (putenv(env[i]) != 0) error(0, 0, "putenv %s failed", env[i]); } free(env);