[Gnucash-changes] r13594 - gnucash/trunk/src - Invert sense of conditions involving g_setenv() since its return value

Chris Shoemaker chris at cvs.gnucash.org
Fri Mar 10 20:23:44 EST 2006


Author: chris
Date: 2006-03-10 20:23:43 -0500 (Fri, 10 Mar 2006)
New Revision: 13594
Trac: http://svn.gnucash.org/trac/changeset/13594

Modified:
   gnucash/trunk/src/backend/file/sixtp-utils.c
   gnucash/trunk/src/backend/file/test/test-save-in-lang.c
   gnucash/trunk/src/gnc-module/gnc-module.c
Log:
   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().


Modified: gnucash/trunk/src/backend/file/sixtp-utils.c
===================================================================
--- gnucash/trunk/src/backend/file/sixtp-utils.c	2006-03-10 23:32:53 UTC (rev 13593)
+++ gnucash/trunk/src/backend/file/sixtp-utils.c	2006-03-11 01:23:43 UTC (rev 13594)
@@ -391,13 +391,13 @@
 
   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

Modified: gnucash/trunk/src/backend/file/test/test-save-in-lang.c
===================================================================
--- gnucash/trunk/src/backend/file/test/test-save-in-lang.c	2006-03-10 23:32:53 UTC (rev 13593)
+++ gnucash/trunk/src/backend/file/test/test-save-in-lang.c	2006-03-11 01:23:43 UTC (rev 13594)
@@ -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 @@
             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 @@
                 break;
             }
 
-            if(setenv("LANG", base_env, 1) != 0)
+            if (!g_setenv("LANG", base_env, 1))
             {
               failure_args("setenv", __FILE__, __LINE__,
                            "setenv of LANG failed");

Modified: gnucash/trunk/src/gnc-module/gnc-module.c
===================================================================
--- gnucash/trunk/src/gnc-module/gnc-module.c	2006-03-10 23:32:53 UTC (rev 13593)
+++ gnucash/trunk/src/gnc-module/gnc-module.c	2006-03-11 01:23:43 UTC (rev 13594)
@@ -140,7 +140,7 @@
     }
     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");
     }



More information about the gnucash-changes mailing list