]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: log error details if F_SETLK fails
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 20 Sep 2017 17:02:44 +0000 (14:02 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Thu, 21 Sep 2017 16:27:50 +0000 (13:27 -0300)
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>
lib/pid_output.c

index e2e443415003814f0350bfab9e7347a8f3f197f5..9a7307bc4f7937ab29ced4986d567f85dce8b2e3 100644 (file)
@@ -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);
                }