[Gnucash-changes] r13542 - gnucash/trunk - Replace setenv() by
g_setenv for increased cross-platform
Christian Stimming
cstim at cvs.gnucash.org
Wed Mar 8 11:00:10 EST 2006
Author: cstim
Date: 2006-03-08 11:00:09 -0500 (Wed, 08 Mar 2006)
New Revision: 13542
Trac: http://svn.gnucash.org/trac/changeset/13542
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/src/backend/file/sixtp-utils.c
gnucash/trunk/src/gnc-module/gnc-module.c
Log:
Replace setenv() by g_setenv for increased cross-platform
compatibility.
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-03-08 15:59:46 UTC (rev 13541)
+++ gnucash/trunk/ChangeLog 2006-03-08 16:00:09 UTC (rev 13542)
@@ -1,5 +1,12 @@
2006-03-08 Christian Stimming <stimming at tuhh.de>
+ * src/gnc-module/gnc-module.c, src/backend/file/sixtp-utils.c:
+ Replace setenv() by g_setenv for increased cross-platform
+ compatibility.
+
+ * src/engine/gnc-filepath-utils.c: Replace mkdir by g_mkdir for
+ increased cross-platform compatibility.
+
* src/core-utils/gnc-gconf-utils.c,
src/business/business-gnome/business-urls.c
src/gnome-utils/dialog-preferences.c
Modified: gnucash/trunk/src/backend/file/sixtp-utils.c
===================================================================
--- gnucash/trunk/src/backend/file/sixtp-utils.c 2006-03-08 15:59:46 UTC (rev 13541)
+++ gnucash/trunk/src/backend/file/sixtp-utils.c 2006-03-08 16:00:09 UTC (rev 13542)
@@ -39,9 +39,6 @@
#include <errno.h>
#ifdef GNUCASH_MAJOR_VERSION
-#ifndef HAVE_SETENV
-#include "setenv.h"
-#endif
#ifndef HAVE_STRPTIME
#include "strptime.h"
#endif
@@ -394,19 +391,19 @@
old_tz = getenv ("TZ");
/* FIXME: there's no way to report this error to the caller. */
- if(setenv("TZ", "UTC", 1) != 0)
+ if(g_setenv("TZ", "UTC", 1) != 0)
PERR ("couldn't switch the TZ.");
result = mktime (tm);
if(old_tz)
{
/* FIXME: there's no way to report this error to the caller. */
- if(setenv("TZ", old_tz, 1) != 0)
+ if(g_setenv("TZ", old_tz, 1) != 0)
PERR ("couldn't switch the TZ back.");
}
else
{
/* FIXME: there's no way to report this error to the caller. */
- unsetenv("TZ");
+ g_unsetenv("TZ");
if(errno != 0)
PERR ("couldn't restore the TZ to undefined.");
}
Modified: gnucash/trunk/src/gnc-module/gnc-module.c
===================================================================
--- gnucash/trunk/src/gnc-module/gnc-module.c 2006-03-08 15:59:46 UTC (rev 13541)
+++ gnucash/trunk/src/gnc-module/gnc-module.c 2006-03-08 16:00:09 UTC (rev 13542)
@@ -14,9 +14,6 @@
#include <sys/types.h>
#include <dirent.h>
-#ifndef HAVE_SETENV
-#include "setenv.h"
-#endif
#include "gnc-module.h"
#include "gw-gnc-module.h"
@@ -143,7 +140,7 @@
}
g_list_free(dirs);
- if(setenv("LD_LIBRARY_PATH", envt, 1) != 0)
+ if(g_setenv("LD_LIBRARY_PATH", envt, 1) != 0)
{
g_warning ("gnc-module failed to set LD_LIBRARY_PATH");
}
More information about the gnucash-changes
mailing list