1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-09 09:57:48 +03:00

s3-libpidfile: some more debug output

Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Björn Baumbach 2012-07-02 15:30:49 +02:00 committed by Michael Adam
parent 2105400028
commit a440df93a6

View File

@ -89,20 +89,26 @@ pid_t pidfile_pid(const char *program_name)
pid = (pid_t)ret; pid = (pid_t)ret;
if (!process_exists_by_pid(pid)) { if (!process_exists_by_pid(pid)) {
DEBUG(10, ("Process with PID=%d does not exist.\n", (int)pid));
goto noproc; goto noproc;
} }
if (fcntl_lock(fd,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 */ /* we could get the lock - it can't be a Samba process */
DEBUG(10, ("Process with PID=%d is no Samba process.\n",
(int)pid));
goto noproc; goto noproc;
} }
DEBUG(10, ("Process with PID=%d is running.\n", (int)pid));
SAFE_FREE(pidFile); SAFE_FREE(pidFile);
close(fd); close(fd);
return (pid_t)ret; return (pid_t)ret;
noproc: noproc:
close(fd); close(fd);
DEBUG(10, ("Deleting %s, since %d is no Samba process.\n", pidFile,
(int)pid));
unlink(pidFile); unlink(pidFile);
SAFE_FREE(pidFile); SAFE_FREE(pidFile);
return 0; return 0;