[Gnucash-changes] r13541 - gnucash/trunk/src/engine - Replace mkdir by g_mkdir for

Christian Stimming cstim at cvs.gnucash.org
Wed Mar 8 10:59:46 EST 2006


Author: cstim
Date: 2006-03-08 10:59:46 -0500 (Wed, 08 Mar 2006)
New Revision: 13541
Trac: http://svn.gnucash.org/trac/changeset/13541

Modified:
   gnucash/trunk/src/engine/gnc-filepath-utils.c
Log:
Replace mkdir by g_mkdir for
increased cross-platform compatibility.


Modified: gnucash/trunk/src/engine/gnc-filepath-utils.c
===================================================================
--- gnucash/trunk/src/engine/gnc-filepath-utils.c	2006-03-08 15:52:51 UTC (rev 13540)
+++ gnucash/trunk/src/engine/gnc-filepath-utils.c	2006-03-08 15:59:46 UTC (rev 13541)
@@ -35,6 +35,7 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <glib/gprintf.h>
+#include <glib/gstdio.h>
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -77,13 +78,13 @@
      * and not because its read-protected or other error.
      * Go ahead and make it. Don't bother much with checking mkdir 
      * for errors; seems pointless. */
-    mkdir (path, S_IRWXU);   /* perms = S_IRWXU = 0700 */
+    g_mkdir (path, S_IRWXU);   /* perms = S_IRWXU = 0700 */
   }
 
   data = g_strconcat (path, "/data", NULL);
   rc = stat (data, &statbuf);
   if (rc)
-    mkdir (data, S_IRWXU);
+    g_mkdir (data, S_IRWXU);
 
   g_free (path);
   g_free (data);
@@ -321,7 +322,7 @@
   if (rc) {
     switch (errno) {
     case ENOENT:
-      rc = mkdir (dirname, S_IRWXU);   /* perms = S_IRWXU = 0700 */
+      rc = g_mkdir (dirname, S_IRWXU);   /* perms = S_IRWXU = 0700 */
       if (rc) {
 	g_fprintf(stderr,
 		  _("An error occurred while creating the directory:\n"



More information about the gnucash-changes mailing list