H_UP notification regarless scheduled downtime

Andreas Ericsson ae at op5.se
Tue Nov 6 19:34:08 CET 2012


On 11/06/2012 07:23 PM, Ricardo Jose Maraschini wrote:
> * 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

The pointer check left behind, along with its warning, is also unnecessary.
There's no way we can find the service and not the host anymore.

> Have a nice vacation.
> 

Thanks :)

> 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;
>   		}
> 


-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
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