<tt><font size=2>Ethan Galstad <egalstad@users.sourceforge.net>
schrieb am 11.08.2009 18:53:06:<br>
</font></tt>
<br><tt><font size=2>> Index: nagios.c<br>
> ===================================================================<br>
> RCS file: /cvsroot/nagios/nagios/base/nagios.c,v<br>
> retrieving revision 1.172<br>
> retrieving revision 1.173<br>
> diff -C2 -d -r1.172 -r1.173<br>
> *** nagios.c   31 Jul 2009 16:54:20 -0000   1.172<br>
> --- nagios.c   11 Aug 2009 16:53:04 -0000   1.173<br>
> ***************<br>
> *** 607,610 ****<br>
> --- 607,625 ----<br>
>                 }<br>
>   <br>
> + #undef TEST_TIMEPERIODS<br>
> + #ifdef TEST_TIMEPERIODS<br>
> +       /* DO SOME TIMEPERIOD TESTING - ADDED 08/11/2009
*/<br>
> +       time_t now, pref_time, valid_time;<br>
> +       timeperiod *tp;<br>
> +       tp=find_timeperiod("247_exclusion");<br>
> +       time(&now);<br>
> +       pref_time=now;<br>
> +       get_next_valid_time(pref_time,&valid_time,tp);<br>
> +       printf("=====\n");<br>
> +       printf("CURRENT:   %lu = %s",(unsigned
long)now,ctime(&now));<br>
> +       printf("PREFERRED: %lu = %s",(unsigned
long)pref_time,ctime<br>
> (&pref_time));<br>
> +       printf("NEXT:      %lu
= %s",(unsigned long)valid_time,ctime<br>
> (&valid_time));<br>
> +       printf("=====\n");<br>
> + #endif<br>
</font></tt>
<br><tt><font size=2>Hi Ethan!</font></tt>
<br>
<br><tt><font size=2>Am I totally blind or is this just a little bit weired
code?</font></tt>
<br><tt><font size=2>If you #undef TEST_TIMEPERIODS, there is no real sense
in doing an</font></tt>
<br><tt><font size=2>#ifdef TEST_TIMEPERIODS on the next line, or is there?</font></tt>
<br><tt><font size=2>The compiler will optimize it out anyways.</font></tt>
<br>
<br><tt><font size=2>Or is my C-foo blinded by the fact it's 9am and I
didn't have my</font></tt>
<br><tt><font size=2>second coffee yet? ;-)</font></tt>
<br>
<br><tt><font size=2>Regards</font></tt>
<br><tt><font size=2>        Sascha</font></tt>
<br>
<br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">GFKL Financial Services AG</span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">Vorstand: Dr. Peter Jänsch (Vors.), Jürgen Baltes, Dr. Tom Haverkamp</span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">Vorsitzender des Aufsichtsrats: Dr. Georg F. Thoma</span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">Sitz: Limbecker Platz 1, 45127 Essen, Amtsgericht Essen, HRB 13522</span>