From b041e5dddfc729951e42db4b808fffe8cd9861c7 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Mon, 1 Mar 2010 18:45:32 +0000 Subject: [PATCH] MSVC compatibility: Somehow fdopen() doesn't work during the trace file initialization. Use fopen() instead. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18775 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/libqof/qof/qoflog.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libqof/qof/qoflog.c b/src/libqof/qof/qoflog.c index f47cd31573..33ee5a609b 100644 --- a/src/libqof/qof/qoflog.c +++ b/src/libqof/qof/qoflog.c @@ -158,8 +158,14 @@ qof_log_init_filename(const gchar* log_filename) 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 {