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;
}
ret = atoi(pidstr);
- if (!process_exists(ret)) {
+ if (!process_exists((pid_t)ret)) {
goto ok;
}
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);
}
}
/* Leave pid file open & locked for the duration... */
}
-