From 7ced1a65298277dac9ac64fc148a2095f44dca01 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 3 Jun 2020 22:49:36 +0200 Subject: [PATCH] err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status By way of good example, use the an EXIT_* symbolic constant, rather than a hard-coded number. Signed-off-by: Michael Kerrisk --- man3/err.3 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/man3/err.3 b/man3/err.3 index d009042d6..0e62b412c 100644 --- a/man3/err.3 +++ b/man3/err.3 @@ -147,10 +147,10 @@ information string and exit: .EX p = malloc(size); if (p == NULL) - err(1, NULL); + err(EXIT_FAILURE, NULL); fd = open(file_name, O_RDONLY, 0); if (fd == \-1) - err(1, "%s", file_name); + err(EXIT_FAILURE, "%s", file_name); .EE .in .PP @@ -159,7 +159,8 @@ Display an error message and exit: .in +4n .EX if (tm.tm_hour < START_TIME) - errx(1, "too early, wait until %s", start_time_string); + errx(EXIT_FAILURE, "too early, wait until %s", + start_time_string); .EE .in .PP @@ -173,7 +174,7 @@ if (fd == \-1) raw_device, strerror(errno)); fd = open(block_device, O_RDONLY, 0); if (fd == \-1) - err(1, "%s", block_device); + err(EXIT_FAILURE, "%s", block_device); .EE .in .SH SEE ALSO