Log rotate: improved handling of return values from syscalls

- Align the two implementations in logit.c and utmp-api.c
 - Use libite APIs to handle common constructs
 - If gzip fails, don't remove rotated-to file
 - Don't try gzip if rename fails
 - Issues found by Coverity Scan

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-03-07 09:57:07 +01:00
1 parent 77aa941e84
commit 790a316607
3 files changed
+37 -23

No files matched your search

+2
View File
@@ -21,6 +21,8 @@ if LOGIT
pkglibexec_PROGRAMS = logit
logit_SOURCES = logit.c
logit_CFLAGS = -W -Wall -Wextra -Wno-unused-parameter -std=gnu99
logit_CFLAGS += $(lite_CFLAGS)
logit_LDADD = $(lite_LIBS)
endif
finit_SOURCES = api.c cgroup.c cgroup.h \