main: Use setenv()

This commit is contained in:
Jasper St. Pierre 2014-02-01 22:34:05 -05:00
parent 183ad75603
commit 66c4555dc7
2 changed files with 4 additions and 9 deletions

View File

@ -28,7 +28,6 @@
*/
#define _GNU_SOURCE
#define _SVID_SOURCE /* for putenv() */
#include <config.h>
#include "keybindings-private.h"

View File

@ -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