Page 1 of 1

Re: [Nagios-devel] [PATCH] schedule_new_event() returns a pointer

Posted: Mon Jun 25, 2012 6:40 am
by Guest
On 06/22/2012 07:59 PM, Ricardo Maraschini wrote:
> Hello,
>
> Please attempt to fix below, maybe we gonna have some problems ahead
> :-) During Nagios compilation I've received the following warning:
>
> commands.c: In function ‘cmd_signal_process’: commands.c:2000:9:
> warning: assignment makes integer from pointer without a cast
> [enabled by default]
>
> Looking to the code, schedule_new_event() returns a pointer to a
> timed_event structure or NULL in case of errors during malloc. As
> cmd_signal_process() returns an integer, i've made a patch to analyse
> the return of schedule_new_event() and give the appropriate return
> code(ERROR || OK).
>
> As I've also seen, we are using cmd_signal_process() only once, and
> it's inside commands.c. The funny thing is that we don't check for
> return code when we call it :-)
>

Rghto. This looks sensible. I'll apply it straight-away.

--
Andreas Ericsson [email protected]
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.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]