[Box Backup-commit] COMMIT r1862 - box/trunk/bin/bbackupd

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Tue, 09 Oct 2007 00:21:48 +0100


Author: chris
Date: 2007-10-09 00:21:48 +0100 (Tue, 09 Oct 2007)
New Revision: 1862

Modified:
   box/trunk/bin/bbackupd/BackupDaemon.cpp
Log:
Fix crash when notifyscript is called for BackupStart or BackupFinish.


Modified: box/trunk/bin/bbackupd/BackupDaemon.cpp
===================================================================
--- box/trunk/bin/bbackupd/BackupDaemon.cpp	2007-09-23 20:17:01 UTC (rev 1861)
+++ box/trunk/bin/bbackupd/BackupDaemon.cpp	2007-10-08 23:21:48 UTC (rev 1862)
@@ -2278,16 +2278,18 @@
 		return;
 	}
 
-	// Is there a notifation script?
+	// Is there a notification script?
 	const Configuration &conf(GetConfiguration());
-	if(!conf.KeyExists("NotifyScript") &&
-		Event != NotifyEvent_BackupStart &&
-		Event != NotifyEvent_BackupFinish)
+	if(!conf.KeyExists("NotifyScript"))
 	{
 		// Log, and then return
-		BOX_ERROR("Not notifying administrator about event "
-			<< sEventNames[Event] << " -- set NotifyScript "
-			"to do this in future");
+		if(Event != NotifyEvent_BackupStart &&
+			Event != NotifyEvent_BackupFinish)
+		{
+			BOX_ERROR("Not notifying administrator about event "
+				<< sEventNames[Event] << " -- set NotifyScript "
+				"to do this in future");
+		}
 		return;
 	}