Re: [Nagios-devel] bug in setting of LASTHOSTCHECK macro (base/utils.c)
Posted: Thu May 19, 2005 3:16 pm
Thanks! There was also a bug in the on-demand macro. Patch will be
in CVS shortly.
On 18 May 2005 at 17:02, Dr. Dave Blunt wrote:
>
> Hi,
>
> The LASTHOSTCHECK macro is being incorrectly set as hst-
> >last_state_change. It should be set as hst->last_check. Patch file
> is attached for base/utils.c and included inline below.
>
> Regards,
>
>
> Dr. Dave Blunt
> Regional Operations Manager
> GroundWork Open Source Solutions
>
>
> *** utils.c Thu Mar 24 17:04:19 2005
> --- modified_utils.c Wed May 18 17:33:45 2005
> ***************
> *** 866,870 ****
> macro_x[MACRO_LASTHOSTCHECK]=(char
> *)malloc(MAX_DATETIME_LENGTH);
> if(macro_x[MACRO_LASTHOSTCHECK]!=NULL){
> !
> snprintf(macro_x[MACRO_LASTHOSTCHECK],MAX_DATETIME_LENGTH,"%lu",(unsig
> ned long)hst->last_state_change);
> macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-
> 1]='\x0';
> }
> --- 866,870 ----
> macro_x[MACRO_LASTHOSTCHECK]=(char
> *)malloc(MAX_DATETIME_LENGTH);
> if(macro_x[MACRO_LASTHOSTCHECK]!=NULL){
> !
> snprintf(macro_x[MACRO_LASTHOSTCHECK],MAX_DATETIME_LENGTH,"%lu",(unsig
> ned long)hst->last_check);
> macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-
> 1]='\x0';
> }
>
>
>
Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
in CVS shortly.
On 18 May 2005 at 17:02, Dr. Dave Blunt wrote:
>
> Hi,
>
> The LASTHOSTCHECK macro is being incorrectly set as hst-
> >last_state_change. It should be set as hst->last_check. Patch file
> is attached for base/utils.c and included inline below.
>
> Regards,
>
>
> Dr. Dave Blunt
> Regional Operations Manager
> GroundWork Open Source Solutions
>
>
> *** utils.c Thu Mar 24 17:04:19 2005
> --- modified_utils.c Wed May 18 17:33:45 2005
> ***************
> *** 866,870 ****
> macro_x[MACRO_LASTHOSTCHECK]=(char
> *)malloc(MAX_DATETIME_LENGTH);
> if(macro_x[MACRO_LASTHOSTCHECK]!=NULL){
> !
> snprintf(macro_x[MACRO_LASTHOSTCHECK],MAX_DATETIME_LENGTH,"%lu",(unsig
> ned long)hst->last_state_change);
> macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-
> 1]='\x0';
> }
> --- 866,870 ----
> macro_x[MACRO_LASTHOSTCHECK]=(char
> *)malloc(MAX_DATETIME_LENGTH);
> if(macro_x[MACRO_LASTHOSTCHECK]!=NULL){
> !
> snprintf(macro_x[MACRO_LASTHOSTCHECK],MAX_DATETIME_LENGTH,"%lu",(unsig
> ned long)hst->last_check);
> macro_x[MACRO_LASTHOSTCHECK][MAX_DATETIME_LENGTH-
> 1]='\x0';
> }
>
>
>
Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]