[Box Backup-dev] COMMIT r425 - box/chris/win32/vc2005-compile-fixes/lib/win32

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Sat Feb 11 22:12:45 GMT 2006


Author: chris
Date: 2006-02-11 22:12:38 +0000 (Sat, 11 Feb 2006)
New Revision: 425

Modified:
   box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp
Log:
* emu.cpp
- Only warn once if the system event log is full


Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp	2006-02-11 22:12:06 UTC (rev 424)
+++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp	2006-02-11 22:12:38 UTC (rev 425)
@@ -983,6 +983,7 @@
 }
 
 HANDLE gSyslogH = 0;
+static bool sHaveWarnedEventLogFull = FALSE;
 
 void syslog(int loglevel, const char *frmt, ...)
 {
@@ -1043,9 +1044,25 @@
 
 	{
 		DWORD err = GetLastError();
-		printf("Unable to send message to Event Log: "
-			"error %i:\r\n", (int)err);
+		if (err == ERROR_LOG_FILE_FULL)
+		{
+			if (!sHaveWarnedEventLogFull)
+			{
+				printf("Unable to send message to Event Log "
+					"(Event Log is full):\r\n");
+				sHaveWarnedEventLogFull = TRUE;
+			}
+		}
+		else
+		{
+			printf("Unable to send message to Event Log: "
+				"error %i:\r\n", (int)err);
+		}
 	}
+	else
+	{
+		sHaveWarnedEventLogFull = FALSE;
+	}
 
 	printf("%s\r\n", buffer);
 }




More information about the Boxbackup-dev mailing list