=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/newsyslog/newsyslog.c,v retrieving revision 1.111 retrieving revision 1.112 diff -c -r1.111 -r1.112 *** src/usr.bin/newsyslog/newsyslog.c 2019/06/28 05:35:34 1.111 --- src/usr.bin/newsyslog/newsyslog.c 2019/06/28 13:35:02 1.112 *************** *** 1,4 **** ! /* $OpenBSD: newsyslog.c,v 1.111 2019/06/28 05:35:34 deraadt Exp $ */ /* * Copyright (c) 1999, 2002, 2003 Todd C. Miller --- 1,4 ---- ! /* $OpenBSD: newsyslog.c,v 1.112 2019/06/28 13:35:02 deraadt Exp $ */ /* * Copyright (c) 1999, 2002, 2003 Todd C. Miller *************** *** 922,928 **** return; } pid = fork(); ! if (pid < 0) { err(1, "fork"); } else if (pid == 0) { (void)execl(COMPRESS, base, "-f", tmp, (char *)NULL); --- 922,928 ---- return; } pid = fork(); ! if (pid == -1) { err(1, "fork"); } else if (pid == 0) { (void)execl(COMPRESS, base, "-f", tmp, (char *)NULL); *************** *** 956,965 **** (void)snprintf(file, sizeof(file), "%s.0", ent->log); if (ent->flags & CE_COMPACT) { if (stat_suffix(file, sizeof(file), COMPRESS_POSTFIX, &sb, ! stat) < 0 && stat(file, &sb) < 0) return (-1); } else { ! if (stat(file, &sb) < 0 && stat_suffix(file, sizeof(file), COMPRESS_POSTFIX, &sb, stat) < 0) return (-1); } --- 956,965 ---- (void)snprintf(file, sizeof(file), "%s.0", ent->log); if (ent->flags & CE_COMPACT) { if (stat_suffix(file, sizeof(file), COMPRESS_POSTFIX, &sb, ! stat) < 0 && stat(file, &sb) == -1) return (-1); } else { ! if (stat(file, &sb) == -1 && stat_suffix(file, sizeof(file), COMPRESS_POSTFIX, &sb, stat) < 0) return (-1); } *************** *** 1006,1012 **** FILE *fp; int rd; ! if (stat(ent->log, &sb) < 0) return (0); if (noaction) { --- 1006,1012 ---- FILE *fp; int rd; ! if (stat(ent->log, &sb) == -1) return (0); if (noaction) { *************** *** 1027,1033 **** STATS_DIR, flog); /* ..if it doesn't exist, simply record the current size. */ ! if ((sb.st_size == 0) || stat(fname, &tsb) < 0) goto update; fp = fopen(fname, "r"); --- 1027,1033 ---- STATS_DIR, flog); /* ..if it doesn't exist, simply record the current size. */ ! if ((sb.st_size == 0) || stat(fname, &tsb) == -1) goto update; fp = fopen(fname, "r");