summaryrefslogtreecommitdiff
path: root/multipathd/pidfile.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2022-01-14 13:50:16 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2022-01-14 13:50:16 +0900
commit49adf6657054f7c3cff8a7c21f93954efa9f88bb (patch)
treeab5b4c2cf18a771469dd2ae25d149924cda529e4 /multipathd/pidfile.c
parentc909ffe8ce9605b25a6524b158a8eb6d252ba1b8 (diff)
downloadmultipath-tools-49adf6657054f7c3cff8a7c21f93954efa9f88bb.tar.gz
multipath-tools-49adf6657054f7c3cff8a7c21f93954efa9f88bb.tar.bz2
multipath-tools-49adf6657054f7c3cff8a7c21f93954efa9f88bb.zip
Imported Upstream version 0.6.2upstream/0.6.2
Diffstat (limited to 'multipathd/pidfile.c')
-rw-r--r--multipathd/pidfile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/multipathd/pidfile.c b/multipathd/pidfile.c
index e3fb896..9bac1dd 100644
--- a/multipathd/pidfile.c
+++ b/multipathd/pidfile.c
@@ -8,7 +8,7 @@
#include <unistd.h> /* for unlink() */
#include <fcntl.h> /* for fcntl() */
-#include <debug.h>
+#include "debug.h"
#include "pidfile.h"
@@ -22,7 +22,7 @@ int pidfile_create(const char *pidFile, pid_t pid)
(S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0) {
condlog(0, "Cannot open pidfile [%s], error was [%s]",
pidFile, strerror(errno));
- return 1;
+ return -errno;
}
lock.l_type = F_WRLCK;
lock.l_start = 0;
@@ -60,8 +60,8 @@ int pidfile_create(const char *pidFile, pid_t pid)
"error was [%s]", pidFile, strerror(errno));
goto fail;
}
- return 0;
+ return fd;
fail:
close(fd);
- return 1;
+ return -errno;
}