From: Renato Westphal Date: Wed, 20 Sep 2017 17:02:44 +0000 (-0300) Subject: lib: log error details if F_SETLK fails X-Git-Tag: frr-4.0-dev~277^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e4e451ce15d0970e41cb2c1b5ee65f16e3f64683;p=matthieu%2Ffrr.git 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 --- 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); }