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 <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2017-09-20 14:02:44 -03:00
parent 8b1450b94d
commit e4e451ce15

View File

@ -57,7 +57,8 @@ pid_t pid_output(const char *path)
lock.l_whence = SEEK_SET; lock.l_whence = SEEK_SET;
if (fcntl(fd, F_SETLK, &lock) < 0) { 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); exit(1);
} }