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"); }