From 27eecdc88b8db2d89efcc1205dd437466d50f058 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 11 Jul 2013 11:37:25 -0400 Subject: Use g_setenv and g_getenv for portability --- libs/pbd/epa.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libs/pbd/epa.cc') diff --git a/libs/pbd/epa.cc b/libs/pbd/epa.cc index 8b8a23491b..d8a3cd5a65 100644 --- a/libs/pbd/epa.cc +++ b/libs/pbd/epa.cc @@ -17,6 +17,8 @@ */ +#include + #include #include "pbd/epa.h" @@ -61,7 +63,7 @@ EnvironmentalProtectionAgency::save () /* fetch environment from named environment variable, rather than "environ" */ - const char* estr = getenv (_envname.c_str()); + const char* estr = g_getenv (_envname.c_str()); if (!estr) { return; @@ -117,7 +119,7 @@ EnvironmentalProtectionAgency::restore () const clear (); for (map::const_iterator i = e.begin(); i != e.end(); ++i) { - setenv (i->first.c_str(), i->second.c_str(), 1); + g_setenv (i->first.c_str(), i->second.c_str(), 1); } } @@ -137,6 +139,6 @@ EnvironmentalProtectionAgency::clear () const } string before = estring.substr (0, equal); - unsetenv(before.c_str()); + g_unsetenv(before.c_str()); } } -- cgit v1.2.3