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

Diff for /src/usr.bin/newsyslog/newsyslog.c between version 1.26 and 1.27

version 1.26, 1999/11/07 05:16:28 version 1.27, 1999/11/07 05:31:53
Line 586 
Line 586 
         char    *log;          char    *log;
 {  {
         pid_t   pid;          pid_t   pid;
           char    *base;
         char    tmp[MAXPATHLEN];          char    tmp[MAXPATHLEN];
   
           if ((base = strrchr(COMPRESS, '/')) == NULL)
                   base = COMPRESS;
           else
                   base++;
           if (noaction) {
                   printf("%s %s.0\n", base, log);
                   return;
           }
         pid = fork();          pid = fork();
         (void)sprintf(tmp, "%s.0", log);          (void)sprintf(tmp, "%s.0", log);
         if (pid < 0) {          if (pid < 0) {
                 err(1, "fork");                  err(1, "fork");
         } else if (!pid) {          } else if (!pid) {
                 (void)execl(COMPRESS, "compress", "-f", tmp, 0);                  (void)execl(COMPRESS, base, "-f", tmp, 0);
                 warn(COMPRESS);                  warn(COMPRESS);
                 _exit(1);                  _exit(1);
         }          }

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27