From 941603b05d463a98221f87ae759448e4ab38df07 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 10 Dec 2012 08:31:32 +0400 Subject: [PATCH] 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). --- misc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 ... */ -- 2.40.0