~ubuntu-branches/ubuntu/natty/cron/natty

« back to all changes in this revision

Viewing changes to cron.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-05-02 16:29:29 UTC
  • Revision ID: james.westby@ubuntu.com-20050502162929-wkxmex15khmm2qb8
Tags: 3.0pl1-87ubuntu2
Recommend: postfix | mail-transport-agent

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
# include <time.h>
32
32
#endif
33
33
 
 
34
#include <sys/types.h>
 
35
#include <fcntl.h>
34
36
 
35
37
static  void    usage __P((void)),
36
38
                run_reboot_jobs __P((cron_db *)),
83
85
#endif
84
86
        (void) signal(SIGHUP, sighup_handler);
85
87
 
 
88
        /* Reopen stdin in case some idiot closed it before starting
 
89
           us - it will only be closed, but not having it open here
 
90
           screws up other things that will be opened */
 
91
        if (fdopen(0,"r") == NULL) {
 
92
            (void) open("dev/null", 0);
 
93
        }
 
94
 
86
95
        acquire_daemonlock(0);
87
96
        set_cron_uid();
88
97
        set_cron_cwd();