From: Ivan Maidanski Date: Mon, 10 Dec 2012 04:31:32 +0000 (+0400) Subject: Remove DebugBreak on WriteFile failure (Win32) X-Git-Tag: gc7_4_0~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=941603b05d463a98221f87ae759448e4ab38df07;p=gc Remove DebugBreak on WriteFile failure (Win32) * 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). --- diff --git a/misc.c b/misc.c index b92aea83..aabda705 100644 --- 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 ... */