From 5fd25c0154e965310052f299d5e41e43d0025ca7 Mon Sep 17 00:00:00 2001 From: Chris Shoemaker Date: Sat, 11 Mar 2006 01:23:43 +0000 Subject: [PATCH] Invert sense of conditions involving g_setenv() since its return value is different than that of setenv(). Also, convert last remaining uses of setenv() to g_setenv(). git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13594 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/backend/file/sixtp-utils.c | 4 ++-- src/backend/file/test/test-save-in-lang.c | 7 ++----- src/gnc-module/gnc-module.c | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/backend/file/sixtp-utils.c b/src/backend/file/sixtp-utils.c index 8ec0055f4a..6a14f86e5c 100644 --- a/src/backend/file/sixtp-utils.c +++ b/src/backend/file/sixtp-utils.c @@ -391,13 +391,13 @@ gnc_timegm (struct tm *tm) old_tz = getenv ("TZ"); /* FIXME: there's no way to report this error to the caller. */ - if(g_setenv("TZ", "UTC", 1) != 0) + if (!g_setenv("TZ", "UTC", 1)) 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(g_setenv("TZ", old_tz, 1) != 0) + if (!g_setenv("TZ", old_tz, 1)) PERR ("couldn't switch the TZ back."); } else diff --git a/src/backend/file/test/test-save-in-lang.c b/src/backend/file/test/test-save-in-lang.c index 0fff32c1c1..a8b1b22c94 100644 --- a/src/backend/file/test/test-save-in-lang.c +++ b/src/backend/file/test/test-save-in-lang.c @@ -11,9 +11,6 @@ #include "test-engine-stuff.h" #include "test-file-stuff.h" -#ifndef HAVE_SETENV -#include "setenv.h" -#endif #include "gnc-engine.h" #include "TransLog.h" @@ -94,7 +91,7 @@ test_file(const char *filename) return g_strdup_printf("qof_session_load errorid %d", err); } - if(setenv("LANG", possible_envs[i], 1) != 0) + if (!g_setenv("LANG", possible_envs[i], 1)) return g_strdup_printf("setenv for LANG"); new_session = qof_session_new(); @@ -166,7 +163,7 @@ main(int argc, char **argv) break; } - if(setenv("LANG", base_env, 1) != 0) + if (!g_setenv("LANG", base_env, 1)) { failure_args("setenv", __FILE__, __LINE__, "setenv of LANG failed"); diff --git a/src/gnc-module/gnc-module.c b/src/gnc-module/gnc-module.c index c28dbc4c80..d2085c774c 100644 --- a/src/gnc-module/gnc-module.c +++ b/src/gnc-module/gnc-module.c @@ -140,7 +140,7 @@ gnc_module_system_setup_load_path(void) } g_list_free(dirs); - if(g_setenv("LD_LIBRARY_PATH", envt, 1) != 0) + if (!g_setenv("LD_LIBRARY_PATH", envt, 1)) { g_warning ("gnc-module failed to set LD_LIBRARY_PATH"); }