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 {