From: Philip Brown Date: Sat, 16 Oct 2010 20:16:51 +0000 (-0400) Subject: setenv and unsetenv dont exist in Solaris 9. (Fixes bug #4663) X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fopenbox;a=commitdiff_plain;h=d082572b17443b1e8a72d8b893d720e99aaf3dfe setenv and unsetenv dont exist in Solaris 9. (Fixes bug #4663) Seeing as how you already use glib, I just substituted g_setenv and g_unsetenv as appropriate, and it now works for me. --- diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c index fdce77b7..380ffa00 100644 --- a/openbox/actions/execute.c +++ b/openbox/actions/execute.c @@ -260,7 +260,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) if (o->sn) { if (!ok) sn_spawn_cancel(); - unsetenv("DESKTOP_STARTUP_ID"); + g_unsetenv("DESKTOP_STARTUP_ID"); } g_free(program); diff --git a/openbox/openbox.c b/openbox/openbox.c index 9fd5fe40..d5ed2b82 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -196,7 +196,7 @@ gint main(gint argc, gchar **argv) /* set the DISPLAY environment variable for any lauched children, to the display we're using, so they open in the right place. */ - setenv("DISPLAY", DisplayString(obt_display), TRUE); + g_setenv("DISPLAY", DisplayString(obt_display), TRUE); /* create available cursors */ cursors[OB_CURSOR_NONE] = None; @@ -589,12 +589,12 @@ static void parse_env(void) const gchar *id; /* unset this so we don't pass it on unknowingly */ - unsetenv("DESKTOP_STARTUP_ID"); + g_unsetenv("DESKTOP_STARTUP_ID"); /* this is how gnome-session passes in a session client id */ id = g_getenv("DESKTOP_AUTOSTART_ID"); if (id) { - unsetenv("DESKTOP_AUTOSTART_ID"); + g_unsetenv("DESKTOP_AUTOSTART_ID"); if (ob_sm_id) g_free(ob_sm_id); ob_sm_id = g_strdup(id); ob_debug_type(OB_DEBUG_SM, diff --git a/openbox/startupnotify.c b/openbox/startupnotify.c index 16654cfd..e249002b 100644 --- a/openbox/startupnotify.c +++ b/openbox/startupnotify.c @@ -263,7 +263,7 @@ void sn_setup_spawn_environment(const gchar *program, const gchar *name, 20 * 1000, sn_launch_wait_timeout, sn_launcher, (GDestroyNotify)sn_launcher_context_unref); - setenv("DESKTOP_STARTUP_ID", id, TRUE); + g_setenv("DESKTOP_STARTUP_ID", id, TRUE); g_free(desc); }