The Samba-Bugzilla – Attachment 4626 Details for
Bug 6686
Does not unlink PID files that cannot be opened
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Unlink the pidfile if it exists but cannot be opened
0001-Unlink-the-pidfile-if-it-exists-but-cannot-be-opened.patch (text/plain), 1.09 KB, created by
Matt Kraai (mail address dead)
on 2009-09-02 17:08:29 UTC
(
hide
)
Description:
Unlink the pidfile if it exists but cannot be opened
Filename:
MIME Type:
Creator:
Matt Kraai (mail address dead)
Created:
2009-09-02 17:08:29 UTC
Size:
1.09 KB
patch
obsolete
>From 6b86d087d2a28975f52e68cf7814da173fb41da6 Mon Sep 17 00:00:00 2001 >From: Matt Kraai <mkraai@beckman.com> >Date: Wed, 2 Sep 2009 15:06:50 -0700 >Subject: [PATCH] Unlink the pidfile if it exists but cannot be opened. > >--- > source3/lib/pidfile.c | 4 ++++ > source4/smbd/pidfile.c | 4 ++++ > 2 files changed, 8 insertions(+), 0 deletions(-) > >diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c >index 2c52d12..48a45fb 100644 >--- a/source3/lib/pidfile.c >+++ b/source3/lib/pidfile.c >@@ -43,6 +43,10 @@ pid_t pidfile_pid(const char *name) > > fd = sys_open(pidFile, O_NONBLOCK | O_RDONLY, 0644); > if (fd == -1) { >+ if (errno != ENOENT) { >+ unlink(pidFile); >+ } >+ > SAFE_FREE(pidFile); > return 0; > } >diff --git a/source4/smbd/pidfile.c b/source4/smbd/pidfile.c >index 44600d3..eb39aa9 100644 >--- a/source4/smbd/pidfile.c >+++ b/source4/smbd/pidfile.c >@@ -44,6 +44,10 @@ pid_t pidfile_pid(const char *piddir, const char *name) > fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644); > > if (fd == -1) { >+ if (errno != ENOENT) { >+ unlink(pidFile); >+ } >+ > SAFE_FREE(pidFile); > return 0; > } >-- >1.6.4.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 6686
: 4626