- Fix background operation to really go into background

OBS-URL: https://build.opensuse.org/package/show/security:Stunnel/stunnel?expand=0&rev=59
This commit is contained in:
Daniel Rahn 2012-07-23 09:17:43 +00:00 committed by Git OBS Bridge
parent 465bbc0a2f
commit be2c0bb17f
3 changed files with 38 additions and 0 deletions

31
stunnel-daemonize.diff Normal file
View File

@ -0,0 +1,31 @@
--- src/stunnel.c
+++ src/stunnel.c
@@ -429,8 +429,8 @@
}
static int daemonize(int fd) { /* go to background */
- if(global_options.option.foreground)
- return 0;
+ if(!(global_options.option.foreground))
+ {
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
@@ -441,6 +441,7 @@
ioerror("daemon");
return 1;
}
+
#else
chdir("/");
switch(fork()) {
@@ -456,7 +457,9 @@
#ifdef HAVE_SETSID
setsid(); /* ignore the error */
#endif
+ }
return 0;
+
}
static int create_pid(void) {

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Jul 23 09:17:13 UTC 2012 - drahn@suse.com
- Fix background operation to really go into background
-------------------------------------------------------------------
Sat Jul 21 06:19:39 UTC 2012 - drahn@suse.com

View File

@ -34,6 +34,7 @@ Source3: sysconfig.syslog-stunnel
Source4: stunnel.rc
Patch0: stunnel-listenqueue-option.patch
Patch1: stunnel3-binpath.patch
Patch2: stunnel-daemonize.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define VENDOR SUSE
@ -61,6 +62,7 @@ stunnel.
%setup -q
# %patch0 -p0
%patch1 -p0
%patch2 -p0
%build
#autoreconf -fi