You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Ralf S. Engelschall" <rs...@engelschall.com> on 1998/07/21 12:45:56 UTC
[PATCH] Fix ap_bspawn_child() for Win32
In my queue (and in STATUS) there is the following patch for a long time now.
I cannot test it myself but it looks correct to me as far as I can say this
for Win32. The problem is that currently you get a SIGSEGV under Win32 because
ap_bspawn_child() passes just NULL as the child_info which is bogus. The
below patch (from a Win32 guy who said RewriteMaps programs then work fine
under Win32) fixes this by providing at least a reasonable child_info
instead of NULL. Please Win32-aware hackers, test this for me and vote on
it. I'm not very happy to still have a SIGSEGV under Win32 for RewriteMap
programs.
Thanks.
Ralf S. Engelschall
rse@engelschall.com
www.engelschall.com
Index: src/CHANGES
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/CHANGES,v
retrieving revision 1.974
diff -u -r1.974 CHANGES
--- CHANGES 1998/07/21 10:20:24 1.974
+++ CHANGES 1998/07/21 10:39:18
@@ -1,5 +1,9 @@
Changes with Apache 1.3.2
+ *) Fix ap_spawn_child() by providing a child_info structure.
+ This fixes at least the RewriteMap programs under Win32.
+ [Marco De Michele <md...@tin.it>] PR#2483
+
*) Fix SHARED_CORE rule: The CFLAGS_SHLIB variable is no longer doubled
(compilers complained) and the .so.V.R.P filename extension was adjusted
to correctly reflect the 1.3.2 version.
Index: src/main/alloc.c
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/main/alloc.c,v
retrieving revision 1.96
diff -u -r1.96 alloc.c
--- alloc.c 1998/06/13 15:22:52 1.96
+++ alloc.c 1998/06/29 12:28:42
@@ -1850,6 +1850,7 @@
HANDLE thread_handle;
int hStdIn, hStdOut, hStdErr;
int old_priority;
+ child_info info;
(void) ap_acquire_mutex(spawn_mutex);
thread_handle = GetCurrentThread(); /* doesn't need to be closed */
@@ -1876,7 +1877,11 @@
close(err_fds[1]);
}
- pid = (*func) (data, NULL);
+ info.hPipeInputRead = GetStdHandle(STD_INPUT_HANDLE);
+ info.hPipeOutputWrite = GetStdHandle(STD_OUTPUT_HANDLE);
+ info.hPipeErrorWrite = GetStdHandle(STD_ERROR_HANDLE);
+
+ pid = (*func) (data, &info);
if (pid == -1) pid = 0; /* map Win32 error code onto Unix default */
if (!pid) {