* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: database.c,v 1.81 2007-10-14 14:58:07 thib Exp $ */
+ /* $Id: database.c,v 1.82 2008-05-11 10:56:28 thib Exp $ */
#include "fcron.h"
void resize_exe_array(void);
-#ifndef HAVE_SETENV
+#if !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV)
char env_tz[PATH_LEN];
#endif
* otherwise, sets TZ to orig_tz */
{
if ( orig_tz == NULL) {
-#ifdef HAVE_SETENV
+#ifdef HAVE_UNSETENV
unsetenv("TZ");
#else
- env_tz[0] = '\0';
+ snprintf(env_tz, sizeof(env_tz) - 1, "TZ=");
+ env_tz[sizeof(env_tz)-1] = '\0';
if ( putenv(env_tz) < 0 )
error_e("could not flush env var TZ");
#endif
* period of execution= a continuous interval of time during which
* the line is to be executed once and only once. */
{
+ int max = 0;
/* sanity check */
if ( ! is_freq_periodically(line->cl_option) )
/* number of days in ftime's month */
- int max = get_nb_mdays(ftime->tm_year, ftime->tm_mon);
+ max = get_nb_mdays(ftime->tm_year, ftime->tm_mon);
/* STEP 1: find the beginning of the next period without ensuring
* there is no overflow (min>=60, hour>=24, etc) */