diff options
author | Dawid Gajownik <gajownik@gmail.com> | 2015-08-09 12:50:40 -0300 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2015-08-10 15:28:46 -0700 |
commit | f3c83363200fd335f37119cb1d238b0e47fd4299 (patch) | |
tree | 20eeaf149692353193087bad0a5ebe7b99a94529 | |
parent | 2f7d33d984a93b46ba87e032c0709eae9d50fe0b (diff) |
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 <gajownik@gmail.com>
-rw-r--r-- | src/weston-launch.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |