git: 6cf1afeccd8a - main - newsyslog: check for rename failure during log rotation
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 27 Mar 2026 19:29:43 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=6cf1afeccd8aaf926c58c5f0ee24ca3d2329a0ce
commit 6cf1afeccd8aaf926c58c5f0ee24ca3d2329a0ce
Author: Christos Longros <chris.longros@gmail.com>
AuthorDate: 2026-03-27 19:28:42 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-03-27 19:28:42 +0000
newsyslog: check for rename failure during log rotation
Differential Revision: https://reviews.freebsd.org/D56088
---
usr.sbin/newsyslog/newsyslog.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index 084aeb36b052..fc8ba7df79af 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -1955,9 +1955,9 @@ do_rotate(const struct conf_entry *ent)
if (noaction)
printf("\tmv %s %s\n", zfile1, zfile2);
- else {
- /* XXX - Ought to be checking for failure! */
- (void)rename(zfile1, zfile2);
+ else if (rename(zfile1, zfile2) != 0) {
+ warn("can't mv %s to %s", zfile1, zfile2);
+ continue;
}
change_attrs(zfile2, ent);
if (ent->compress && strlen(logfile_suffix) == 0) {