summaryrefslogtreecommitdiff
path: root/source3/lib/pidfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/pidfile.c')
-rw-r--r--source3/lib/pidfile.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c
index b98259fe5e..28fd959b54 100644
--- a/source3/lib/pidfile.c
+++ b/source3/lib/pidfile.c
@@ -35,7 +35,7 @@ pid_t pidfile_pid(char *name)
unsigned ret;
pstring pidFile;
- slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_piddir(), name);
+ slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_lockdir(), name);
fd = sys_open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
if (fd == -1) {
@@ -68,7 +68,10 @@ pid_t pidfile_pid(char *name)
return 0;
}
-/* create a pid file in the pid directory. open it and leave it locked */
+/* Create a pid file in the lock directory. open it and leave it locked.
+ This must be done after a call to lp_load() as it uses the lp_lockdir()
+ function to generate the path to the pidfile. */
+
void pidfile_create(char *name)
{
int fd;
@@ -76,7 +79,7 @@ void pidfile_create(char *name)
pstring pidFile;
pid_t pid;
- slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_piddir(), name);
+ slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_lockdir(), name);
pid = pidfile_pid(name);
if (pid != 0) {