[BACK]Return to io.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / calendar

Diff for /src/usr.bin/calendar/io.c between version 1.19 and 1.20

version 1.19, 2001/11/19 19:02:13 version 1.20, 2002/10/16 00:30:58
Line 82 
Line 82 
   
   
 void  void
 cal()  cal(void)
 {  {
         int printing;          int printing;
         char *p;          char *p;
Line 315 
Line 315 
   
   
 FILE *  FILE *
 opencal()  opencal(void)
 {  {
         int pdes[2];          int pdes[2], fdin;
         int fdin;          struct stat st;
   
         /* open up calendar file as stdin */          /* open up calendar file as stdin */
         if ((fdin = open(calendarFile, O_RDONLY)) == -1) {          if ((fdin = open(calendarFile, O_RDONLY)) == -1 ||
               fstat(fdin, &st) == -1 || !S_ISREG(st.st_mode)) {
                 if (!doall) {                  if (!doall) {
                         char *home = getenv("HOME");                          char *home = getenv("HOME");
                         if (home == NULL || *home == '\0')                          if (home == NULL || *home == '\0')
Line 333 
Line 334 
                                     calendarFile, calendarHome, calendarFile);                                      calendarFile, calendarHome, calendarFile);
                 }                  }
         }          }
   
         if (pipe(pdes) < 0)          if (pipe(pdes) < 0)
                 return (NULL);                  return (NULL);
         switch (vfork()) {          switch (vfork()) {
Line 348 
Line 350 
                         (void)close(pdes[1]);                          (void)close(pdes[1]);
                 }                  }
                 (void)close(pdes[0]);                  (void)close(pdes[0]);
                 /* Set stderr to /dev/null.  Necessary so that cron does not                  /*
                    * Set stderr to /dev/null.  Necessary so that cron does not
                  * wait for cpp to finish if it's running calendar -a.                   * wait for cpp to finish if it's running calendar -a.
                  */                   */
                 if (doall) {                  if (doall) {

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20