From 66c4555dc7eca43bfb37a5f1c5d27295271b64f0 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 1 Feb 2014 22:34:05 -0500 Subject: [PATCH] main: Use setenv() --- src/core/keybindings.c | 1 - src/core/main.c | 12 ++++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 22aa3a866..f0dca9c25 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -28,7 +28,6 @@ */ #define _GNU_SOURCE -#define _SVID_SOURCE /* for putenv() */ #include #include "keybindings-private.h" diff --git a/src/core/main.c b/src/core/main.c index f22bf8e55..a73015285 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -347,14 +347,10 @@ meta_clutter_init (void) static void meta_select_display (gchar *display_name) { - gchar *envVar = ""; - if (display_name) - envVar = g_strconcat ("DISPLAY=", display_name, NULL); - else if (g_getenv ("MUTTER_DISPLAY")) - envVar = g_strconcat ("DISPLAY=", - g_getenv ("MUTTER_DISPLAY"), NULL); - /* DO NOT FREE envVar, putenv() sucks */ - putenv (envVar); + if (!display_name) + display_name = g_getenv ("MUTTER_DISPLAY"); + + g_setenv ("DISPLAY", display_name, TRUE); } static void