]> granicus.if.org Git - gc/commitdiff
Remove DebugBreak on WriteFile failure (Win32)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 10 Dec 2012 04:31:32 +0000 (08:31 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 10 Dec 2012 11:32:04 +0000 (15:32 +0400)
* misc.c (GC_write): Rename "tmp" local variable to "res"; remove
DebugBreak on WriteFile failure since DebugBreak is a part of ABORT
unless NO_DEBUGGING (only for MSWIN32 and MSWINCE targets).

misc.c

diff --git a/misc.c b/misc.c
index b92aea83a7f99b6c1e87c9529a9820bea7d6705e..aabda705408dd2435d0346b2c727bab45774c512 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1343,7 +1343,7 @@ GC_API void GC_CALL GC_enable_incremental(void)
 
   STATIC int GC_write(const char *buf, size_t len)
   {
-      BOOL tmp;
+      BOOL res;
       DWORD written;
 #     if (defined(THREADS) && defined(GC_ASSERTIONS)) \
          || !defined(GC_PRINT_VERBOSE_STATS)
@@ -1376,9 +1376,7 @@ GC_API void GC_CALL GC_enable_incremental(void)
           }
 #       endif
       }
-      tmp = WriteFile(GC_log, buf, (DWORD)len, &written, NULL);
-      if (!tmp)
-          DebugBreak();
+      res = WriteFile(GC_log, buf, (DWORD)len, &written, NULL);
 #     if defined(_MSC_VER) && defined(_DEBUG)
 #         ifdef MSWINCE
               /* There is no CrtDbgReport() in WinCE */
@@ -1395,7 +1393,7 @@ GC_API void GC_CALL GC_enable_incremental(void)
 #         endif
 #     endif
       IF_NEED_TO_LOCK(LeaveCriticalSection(&GC_write_cs));
-      return tmp ? (int)written : -1;
+      return res ? (int)written : -1;
   }
 
   /* FIXME: This is pretty ugly ... */