r15413 - gnucash/trunk/src/backend/file - Replace creat() by g_open().

Andreas Köhler andi5 at cvs.gnucash.org
Sun Jan 21 17:30:58 EST 2007


Author: andi5
Date: 2007-01-21 17:30:57 -0500 (Sun, 21 Jan 2007)
New Revision: 15413
Trac: http://svn.gnucash.org/trac/changeset/15413

Modified:
   gnucash/trunk/src/backend/file/gnc-backend-file.c
Log:
Replace creat() by g_open().

g_open is necessary to use the wide character api and creat() is
equivalent to open with O_CREAT|O_WRONLY|O_TRUNC.


Modified: gnucash/trunk/src/backend/file/gnc-backend-file.c
===================================================================
--- gnucash/trunk/src/backend/file/gnc-backend-file.c	2007-01-21 22:11:34 UTC (rev 15412)
+++ gnucash/trunk/src/backend/file/gnc-backend-file.c	2007-01-21 22:30:57 UTC (rev 15413)
@@ -347,7 +347,7 @@
     {
         return FALSE;
     }
-    bkup_fd = creat(bkup, 0600);
+    bkup_fd = g_open(bkup, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600);
     if(bkup_fd == -1)
     {
         close(orig_fd);



More information about the gnucash-changes mailing list