From dba7f0f5cee06dcfc205b0284ba19c2651f594c4 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Mon, 17 Jun 2024 11:55:04 +0200 Subject: treewide: Replace strerror() calls Now that we have logging functions embedding perror() functionality, we can make _some_ calls more terse by using them. In many places, the strerror() calls are still more convenient because, for example, they are used in flow debugging functions, or because the return code variable of interest is not 'errno'. While at it, convert a few error messages from a scant perror style to proper failure descriptions. Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'log.c') diff --git a/log.c b/log.c index 528ee51..a72b871 100644 --- a/log.c +++ b/log.c @@ -212,7 +212,7 @@ void logfile_init(const char *name, const char *path, size_t size) log_file = open(path, O_CREAT | O_TRUNC | O_APPEND | O_RDWR | O_CLOEXEC, S_IRUSR | S_IWUSR); if (log_file == -1) - die("Couldn't open log file %s: %s", path, strerror(errno)); + die_perror("Couldn't open log file %s", path); log_size = size ? size : LOGFILE_SIZE_DEFAULT; -- cgit v1.2.3