[PATCH] date: return failure exit code on set time error

Ladislav Michl oss-lists at triops.cz
Wed Jun 14 14:35:06 UTC 2023


From: Ladislav Michl <ladis at linux-mips.org>

Signed-off-by: Ladislav Michl <ladis at linux-mips.org>
---
 coreutils/date.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/coreutils/date.c b/coreutils/date.c
index abcc37c33..0fca89369 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -289,7 +289,7 @@ int date_main(int argc UNUSED_PARAM, char **argv)
 
 		/* if setting time, set it */
 		if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) {
-			bb_simple_perror_msg("can't set date");
+			bb_perror_msg_and_die("can't set date");
 		}
 	}
 
-- 
2.39.2



More information about the busybox mailing list