OBS User unknown 2006-06-23 10:15:07 +00:00 committed by Git OBS Bridge
parent fefdad3941
commit 494977e872

View File

@ -0,0 +1,27 @@
Index: stunnel-4.14/src/stunnel.c
===================================================================
--- stunnel-4.14.orig/src/stunnel.c
+++ stunnel-4.14/src/stunnel.c
@@ -173,8 +173,8 @@ static void daemon_loop(void) {
#if !defined (USE_WIN32) && !defined (__vms)
if(!(options.option.foreground))
daemonize();
- drop_privileges();
create_pid();
+ drop_privileges();
#endif /* !defined USE_WIN32 && !defined (__vms) */
/* create exec+connect services */
@@ -420,8 +420,10 @@ static void delete_pid(void) {
s_log(LOG_DEBUG, "removing pid file %s", options.pidfile);
if((unsigned long)getpid()!=options.dpid)
return; /* current process is not main daemon process */
- if(unlink(options.pidfile)<0)
- ioerror(options.pidfile); /* not critical */
+ if(unlink(options.pidfile)<0) {
+ if(errno!=EACCES && errno!=ENOENT)
+ ioerror(options.pidfile); /* not critical */
+ }
}
static void signal_handler(int sig) { /* signal handler */