r18775 - gnucash/trunk/src/libqof/qof - MSVC compatibility: Somehow fdopen() doesn't work during the trace file initialization. Use fopen() instead.

Christian Stimming cstim at code.gnucash.org
Mon Mar 1 13:45:32 EST 2010


Author: cstim
Date: 2010-03-01 13:45:32 -0500 (Mon, 01 Mar 2010)
New Revision: 18775
Trac: http://svn.gnucash.org/trac/changeset/18775

Modified:
   gnucash/trunk/src/libqof/qof/qoflog.c
Log:
MSVC compatibility: Somehow fdopen() doesn't work during the trace file initialization. Use fopen() instead.

Modified: gnucash/trunk/src/libqof/qof/qoflog.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qoflog.c	2010-03-01 18:45:11 UTC (rev 18774)
+++ gnucash/trunk/src/libqof/qof/qoflog.c	2010-03-01 18:45:32 UTC (rev 18775)
@@ -158,8 +158,14 @@
 
         if ((fd = g_mkstemp(fname)) != -1)
         {
+#ifdef _MSC_VER
+            /* MSVC compiler: Somehow the OS thinks file descriptor from above
+             * still isn't open. So we open normally with the file name and that's it. */
+            fout = g_fopen(fname, "wb");
+#else
             g_rename(fname, log_filename);
             fout = fdopen(fd, "w");
+#endif
         }
         else
         {



More information about the gnucash-changes mailing list