H_UP notification regarless scheduled downtime

Ricardo Jose Maraschini ricardo.maraschini at opservices.com.br
Tue Nov 6 19:23:29 CET 2012


* Andreas Ericsson (ae at op5.se) wrote:
> It looks as if that should be impossible, but I've had a few beers right
> now and I'm leaving for a one-week vacation in egypt in ten hours, so
> I'll have to postpone a further analysis of this patch and its ultimate
> consequences.

Alright then. The code below avoids an uneeded pointer check
Have a nice vacation.

Index: base/notifications.c
===================================================================
--- base/notifications.c	(revision 2455)
+++ base/notifications.c	(working copy)
@@ -338,11 +338,7 @@
 		}
 
 	/* find the host this service is associated with */
-	if((temp_host = (host *)svc->host_ptr) == NULL)
-		return ERROR;
-
-	/* if we couldn't find the host, return an error */
-	if(temp_host == NULL) {
+	if((temp_host = (host *)svc->host_ptr) == NULL) {
 		log_debug_info(DEBUGL_NOTIFICATIONS, 1, "Couldn't find the host associated with this service, so we won't send a notification.\n");
 		return ERROR;
 		}

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d




More information about the Developers mailing list