[PATCH weston] weston-launch: On error putenv returns a non-zero value

Bryce Harrington bryce at osg.samsung.com
Mon Aug 10 15:29:17 PDT 2015


On Sun, Aug 09, 2015 at 12:50:40PM -0300, Dawid Gajownik wrote:
> 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 at gmail.com>

LGTM, pushed:
To ssh://git.freedesktop.org/git/wayland/weston
   2f7d33d..f3c8336  master -> master

> ---
>  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 90a070f..b8dfb17 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);
> -- 
> 2.4.3
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list