This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

apache-1.3.22-4 no-detach patch


Corinna,

could you please apply the attached patch against the last 1.3.22-3
source tree. This will turn detaching of the parent process off.
Please try if this makes cygrunsrv happy.

I haven't included any extra starting flag. In this case apache does
not detach by default for Cygwin. Any objections from the others?

Stipe

tolj@wapme-systems.de
-------------------------------------------------------------------
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: info@wapme-systems.de
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
diff -ur apache_1.3.22-3/src/include/ap_config.h apache_1.3.22-4/src/include/ap_config.h
--- apache_1.3.22-3/src/include/ap_config.h	Tue Jan  8 09:49:58 2002
+++ apache_1.3.22-4/src/include/ap_config.h	Thu Jan 17 23:26:59 2002
@@ -993,6 +993,7 @@
 #elif defined(CYGWIN)               /* Cygwin 1.x POSIX layer for Win32 */
 #define JMP_BUF jmp_buf
 #define NO_KILLPG
+#define NO_SETSID
 #define USE_LONGJMP
 #define GDBM_STATIC
 #define HAVE_MMAP 1
diff -ur apache_1.3.22-3/src/main/http_main.c apache_1.3.22-4/src/main/http_main.c
--- apache_1.3.22-3/src/main/http_main.c	Tue Jan  8 09:49:58 2002
+++ apache_1.3.22-4/src/main/http_main.c	Thu Jan 17 23:31:25 2002
@@ -3293,7 +3293,7 @@
     int x;
 
     chdir("/");
-#if !defined(MPE) && !defined(OS2) && !defined(TPF)
+#if !defined(MPE) && !defined(OS2) && !defined(TPF) && !defined(CYGWIN)
 /* Don't detach for MPE because child processes can't survive the death of
    the parent. */
     if ((x = fork()) > 0)
@@ -3323,6 +3323,13 @@
 #elif defined(MPE)
     /* MPE uses negative pid for process group */
     pgrp = -getpid();
+#elif defined(CYGWIN)
+    /* Cygwin does not take any argument for setpgrp() */
+    if ((pgrp = setpgrp()) == -1) {
+	perror("setpgrp");
+	fprintf(stderr, "%s: setpgrp failed\n", ap_server_argv0);
+	exit(1);
+    }
 #else
     if ((pgrp = setpgrp(getpid(), 0)) == -1) {
 	perror("setpgrp");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]