summaryrefslogtreecommitdiff
path: root/source3/lib/pidfile.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-12-13 13:27:58 +0000
committerAndrew Tridgell <tridge@samba.org>1999-12-13 13:27:58 +0000
commit3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7 (patch)
tree866dd15416c3d8554bb207709f433a87ad0c012d /source3/lib/pidfile.c
parentf6276724bafdb6145c0c7b565172d80cb04516ea (diff)
downloadsamba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.tar.gz
samba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.tar.bz2
samba-3db52feb1f3b2c07ce0b06ad4a7099fa6efe3fc7.zip
first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
Diffstat (limited to 'source3/lib/pidfile.c')
-rw-r--r--source3/lib/pidfile.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c
index 6fc64aafe2..726e8c1f21 100644
--- a/source3/lib/pidfile.c
+++ b/source3/lib/pidfile.c
@@ -39,7 +39,7 @@ pid_t pidfile_pid(char *name)
slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_lockdir(), name);
- fd = open(pidFile, O_NONBLOCK | O_RDWR);
+ fd = sys_open(pidFile, O_NONBLOCK | O_RDWR, 0644);
if (fd == -1) {
return 0;
}
@@ -52,7 +52,7 @@ pid_t pidfile_pid(char *name)
ret = atoi(pidstr);
- if (!process_exists(ret)) {
+ if (!process_exists((pid_t)ret)) {
goto ok;
}
@@ -76,14 +76,14 @@ void pidfile_create(char *name)
int fd;
char buf[20];
pstring pidFile;
- int pid;
+ pid_t pid;
slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_lockdir(), name);
pid = pidfile_pid(name);
if (pid != 0) {
DEBUG(0,("ERROR: %s is already running. File %s exists and process id %d is running.\n",
- name, pidFile, pid));
+ name, pidFile, (int)pid));
exit(1);
}
@@ -109,4 +109,3 @@ void pidfile_create(char *name)
}
/* Leave pid file open & locked for the duration... */
}
-