cron_sync ();
  run_reboot_jobs __P ((cron_db *)),  cron_tick __P ((cron_db *)),  cron_sync __P ((void)), cron_sleep __P ((void)),#ifdef USE_SIGCHLD  sigchld_handler __P ((int)),#endif  sighup_handler __P ((int)),  parse_args __P ((int c, char *v[], int *const p, char **const f));static voidusage (void){  fprintf (stderr, "usage:  %s [-x debugflag[,...]]\n", ProgramName);  exit (ERROR_EXIT);}intmain (int argc, char *argv[]){  cron_db database;  char *config_file;		/*Name of our configuration file; NULL if none */  struct sigaction my_sigaction;  /* We need to put Program_Name in its own storage because later we will   * modify argv[0] in an attempt to change the process name.   */  ProcessName = argv[0];  ProgramName = strdup (argv[0]);#if HAVE_SETLINEBUF  setlinebuf (stdout);  setlinebuf (stderr);#endif /*HAVE_SETLINEBUF */  parse_args (argc, argv, &pass_environment, &config_file);  read_config (config_file, &allow_only_root, &log_syslog, &allow_file,	       &deny_file, &crondir, &spool_dir, &log_file, &syscrontab,	       &lastrun_file, &pidfile, &mailprog, &mailargs);#ifdef USE_SIGCHLD  memset (&my_sigaction, 0, sizeof (my_sigaction));  my_sigaction.sa_handler = sigchld_handler;  my_sigaction.sa_flags |= SA_NOCLDSTOP | SA_NODEFER;  if (sigaction (SIGCHLD, &my_sigaction, NULL))    perror ("sigaction");#else  (void) signal (SIGCHLD, SIG_IGN);#endif  memset (&my_sigaction, 0, sizeof (my_sigaction));  my_sigaction.sa_handler = sigterm_handler;  if (sigaction (SIGTERM, &my_sigaction, NULL))    perror ("sigaction");  memset (&my_sigaction, 0, sizeof (my_sigaction));  my_sigaction.sa_handler = sighup_handler;  if (sigaction (SIGHUP, &my_sigaction, NULL))    perror ("sigaction");  acquire_daemonlock (0);  set_cron_uid ();  set_cron_cwd ();#if HAVE_SETENV  if (!pass_environment)    setenv ("PATH", _PATH_DEFPATH, 1);#endif  /* if there are no debug flags turned on, fork as a daemon should. */#if DEBUGGING  if (DebugFlags)    {#else  if (0)    {#endif      (void) fprintf (stderr, "[%d] cron started\n", getpid ());    }  else    {      switch (fork ())	{	case -1:	  log_it ("CRON", getpid (), "DEATH", "can't fork");	  exit (0);	  break;	case 0:	  /* child process */	  log_it ("CRON", getpid (), "STARTUP", "fork ok");	  (void) setsid ();	  break;	default:	  /* parent process should just die */	  _exit (0);	}    }  acquire_daemonlock (0);  /* initialize waiting for busy disk */  init_diskload ();  database.head = NULL;  database.tail = NULL;  database.mtime = (time_t) 0;  Debug (DMISC, ("about to load database"));  load_database (&database);  Debug (DMISC, ("about to build catch up list"));  build_cu_list (&database, &CatchUpList);  Debug (DMISC, ("about to run reboot jobs"));  run_reboot_jobs (&database);  cron_sync ();  while (TRUE)    {# if DEBUGGING      if (!(DebugFlags & DTEST))# endif	 /*DEBUGGING*/	  cron_sleep ();      load_database (&database);      /* first catch up any jobs that are on the CatchUpList */      if (CatchUpList && (!jhead))	CatchUpList = run_cu_list (CatchUpList);      /* then run the regular jobs for this minute */      cron_tick (&database);      /* sleep 1 minute */      TargetTime += 60;    }}static voidrun_reboot_jobs (cron_db * db){  register user *u;  register entry *e;  for (u = db->head; u != NULL; u = u->next)    {      for (e = u->crontab; e != NULL; e = e->next)	{	  if (e->flags & WHEN_REBOOT)	    {	      job_add (e, u);	    }	}    }  (void) job_runqueue ();}