if (stat (lastrun_flie, &lr) != OK)
if (stat (lastrun_file, &lr) != OK)
build_cu_list (cron_db * db, list_cu ** cul_head){  struct stat lr;  time_t reboot;  time_t curstore;  register time_t *current = &curstore;  register struct tm *curtm;  register user *u;  register entry *e;  char msg[MAX_MSGLEN];  list_cu *cul_tail = NULL;  unsigned int counter = 0;  reboot = time (NULL);  *cul_head = NULL;  if (stat (lastrun_flie, &lr) != OK)    {      Debug (DLOAD, ("could not find lastrun file!\n"));    }  else    {      Debug (DLOAD, ("read lastrun file.\n"));#ifdef DEBUGGING      if (strftime (msg, (size_t) MAX_MSGLEN, "%c", localtime (&lr.st_mtime)))	log_it ("CRON", getpid (), "TIME last", msg);      if (strftime (msg, (size_t) MAX_MSGLEN, "%c", localtime (&reboot)))	log_it ("CRON", getpid (), "TIME reboot", msg);#endif      for (*current = lr.st_mtime; *current < reboot; *current += 60)	{	  /* This is quite inefficient on systems with many jobs/users, instead 	   * we should extract a list of possible catch up jobs first.	   * However, our main audience is home-computers with only a small	   * amount of users, also big systems don't reset that often and	   * this is executed only once for every startup. So here you go.	   */	  for (u = db->head; u != NULL; u = u->next)	    {	      for (e = u->crontab; e != NULL; e = e->next)		{		  if (e->flags & RUN_DOWNTIME)		    {		      /* This might be quite slow. However, if I need to write		       * a routine that is intelligent enough for all the special		       * cases (30/31 days per month, leap years, DST ...) it		       * wouldn't be any faster. Anyway we aren't in a hurry.		       */		      curtm = localtime (current);		      /* to be really clean I'd have to do this:		         curtm->tm_min -= FIRST_MINUTE;		         curtm->tm_hour -= FIRST_HOUR; 		         curtm->tm_mday -= FIRST_DOM;		         curtm->tm_mon = curtm->tm_mon +1 - FIRST_MONTH;		         curtm->tm_wday -= FIRST_DOW;		         * but as the optimizer doesn't recognize that all of these		         * except FIRST_DOM are no-ops, and we are in a time-critical		         * loop, I adjust only FIRST_DOM further down		       */		      if (bit_test (e->minute, curtm->tm_min)			  && bit_test (e->hour, curtm->tm_hour)			  && bit_test (e->month, curtm->tm_mon)			  && (((e->flags & DOM_STAR) || (e->flags & DOW_STAR))			      ? (bit_test (e->dow, curtm->tm_wday)				 && bit_test (e->dom,					      (curtm->tm_mday -					       FIRST_DOM)))			      : (bit_test (e->dow, curtm->tm_wday)				 || bit_test (e->dom,					      (curtm->tm_mday - FIRST_DOM)))))			{			  Debug (DSCH, ("found catch-up job: %s\n", e->cmd));			  counter++;			  if (e->flags & RUN_DOWN_ONCE)			    e->flags &= ~RUN_DOWNTIME;			  if (*cul_head != NULL)			    {			      if (				  (cul_tail->next =				   malloc (sizeof (list_cu))))				{				  cul_tail = cul_tail->next;				  cul_tail->next = NULL;				  cul_tail->cul_u = u;				  cul_tail->cul_e = e;				  cul_tail->rtime = *current;				}			    }			  else			    {			      if ((*cul_head = malloc (sizeof (list_cu))))				{				  cul_tail = *cul_head;				  cul_tail->next = NULL;				  cul_tail->cul_u = u;				  cul_tail->cul_e = e;				  cul_tail->rtime = *current;				}			    }			}	/* if (bit_test) */		    }		/* if (e->flags & RUN_DOWNTIME) */		}		/* for e */	    }			/* for u */	}			/* for *current */      snprintf (msg, MAX_MSGLEN, "%d jobs to catch up", counter);      log_it ("CRON", getpid (), "STARTUP", msg);    }				/* if(-f lastrun_flie) else */}