From e4e451ce15d0970e41cb2c1b5ee65f16e3f64683 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 20 Sep 2017 14:02:44 -0300 Subject: [PATCH] lib: log error details if F_SETLK fails Somehow F_SETLK was failing for me a couple of days ago, and not being able to see the errno value was frustrating. Signed-off-by: Renato Westphal --- lib/pid_output.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pid_output.c b/lib/pid_output.c index e2e4434150..9a7307bc4f 100644 --- a/lib/pid_output.c +++ b/lib/pid_output.c @@ -57,7 +57,8 @@ pid_t pid_output(const char *path) lock.l_whence = SEEK_SET; if (fcntl(fd, F_SETLK, &lock) < 0) { - zlog_err("Could not lock pid_file %s, exiting", path); + zlog_err("Could not lock pid_file %s (%s), exiting", + path, safe_strerror(errno)); exit(1); } -- 2.39.5