SAFE_FREE(name);
- fd = sys_open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
+ fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
if (fd == -1) {
SAFE_FREE(pidFile);
return 0;
goto noproc;
}
- if (fcntl_lock(fd,SMB_F_SETLK,0,1,F_RDLCK)) {
+ if (fcntl_lock(fd,F_SETLK,0,1,F_RDLCK)) {
/* we could get the lock - it can't be a Samba process */
goto noproc;
}
exit(1);
}
- fd = sys_open(pidFile_name, O_NONBLOCK | O_CREAT | O_WRONLY | O_EXCL,
+ fd = open(pidFile_name, O_NONBLOCK | O_CREAT | O_WRONLY | O_EXCL,
0644);
if (fd == -1) {
DEBUG(0,("ERROR: can't open %s: Error was %s\n", pidFile_name,
exit(1);
}
- if (fcntl_lock(fd,SMB_F_SETLK,0,1,F_WRLCK)==False) {
+ if (fcntl_lock(fd,F_SETLK,0,1,F_WRLCK)==False) {
DEBUG(0,("ERROR: %s : fcntl lock of file %s failed. Error was %s\n",
name, pidFile_name, strerror(errno)));
exit(1);
}
memset(buf, 0, sizeof(buf));
- slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int) sys_getpid());
+ slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int)getpid());
if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) {
DEBUG(0,("ERROR: can't write to file %s: %s\n",
pidFile_name, strerror(errno)));