[mutter/wayland] main: Use setenv()



commit 66c4555dc7eca43bfb37a5f1c5d27295271b64f0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sat Feb 1 22:34:05 2014 -0500

    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 22aa3a8..f0dca9c 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -28,7 +28,6 @@
  */
 
 #define _GNU_SOURCE
-#define _SVID_SOURCE /* for putenv() */
 
 #include <config.h>
 #include "keybindings-private.h"
diff --git a/src/core/main.c b/src/core/main.c
index f22bf8e..a730152 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]