[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.111 and 1.112

version 1.111, 2019/06/28 05:35:34 version 1.112, 2019/06/28 13:35:02
Line 922 
Line 922 
                 return;                  return;
         }          }
         pid = fork();          pid = fork();
         if (pid < 0) {          if (pid == -1) {
                 err(1, "fork");                  err(1, "fork");
         } else if (pid == 0) {          } else if (pid == 0) {
                 (void)execl(COMPRESS, base, "-f", tmp, (char *)NULL);                  (void)execl(COMPRESS, base, "-f", tmp, (char *)NULL);
Line 956 
Line 956 
                 (void)snprintf(file, sizeof(file), "%s.0", ent->log);                  (void)snprintf(file, sizeof(file), "%s.0", ent->log);
         if (ent->flags & CE_COMPACT) {          if (ent->flags & CE_COMPACT) {
                 if (stat_suffix(file, sizeof(file), COMPRESS_POSTFIX, &sb,                  if (stat_suffix(file, sizeof(file), COMPRESS_POSTFIX, &sb,
                     stat) < 0 && stat(file, &sb) < 0)                      stat) < 0 && stat(file, &sb) == -1)
                         return (-1);                          return (-1);
         } else {          } else {
                 if (stat(file, &sb) < 0 && stat_suffix(file, sizeof(file),                  if (stat(file, &sb) == -1 && stat_suffix(file, sizeof(file),
                     COMPRESS_POSTFIX, &sb, stat) < 0)                      COMPRESS_POSTFIX, &sb, stat) < 0)
                         return (-1);                          return (-1);
         }          }
Line 1006 
Line 1006 
         FILE *fp;          FILE *fp;
         int rd;          int rd;
   
         if (stat(ent->log, &sb) < 0)          if (stat(ent->log, &sb) == -1)
                 return (0);                  return (0);
   
         if (noaction) {          if (noaction) {
Line 1027 
Line 1027 
             STATS_DIR, flog);              STATS_DIR, flog);
   
         /* ..if it doesn't exist, simply record the current size. */          /* ..if it doesn't exist, simply record the current size. */
         if ((sb.st_size == 0) || stat(fname, &tsb) < 0)          if ((sb.st_size == 0) || stat(fname, &tsb) == -1)
                 goto update;                  goto update;
   
         fp = fopen(fname, "r");          fp = fopen(fname, "r");

Legend:
Removed from v.1.111  
changed lines
  Added in v.1.112