From a7399fa3c214b8a031e431b4737da855f98b1a2d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 27 Feb 2020 14:04:55 +0100 Subject: [PATCH] hwclock: fix audit exit status According to audit_log_user_message(3) result 1 is "success" and 0 is "failed", we use standard EXIT_{SUCCESS,FAILURE} macros with reverse status. Addresses: https://github.com/karelzak/util-linux/issues/966 Signed-off-by: Karel Zak --- sys-utils/hwclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index 1191a85715..89d8a1fd93 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -1464,7 +1464,7 @@ hwclock_exit(const struct hwclock_control *ctl if (ctl->hwaudit_on && !ctl->testing) { audit_log_user_message(hwaudit_fd, AUDIT_USYS_CONFIG, "op=change-system-time", NULL, NULL, NULL, - status); + status == EXIT_SUCCESS ? 1 : 0); } close(hwaudit_fd); #endif -- 2.47.2