bjh 99/04/30 22:15:53
Modified: src CHANGES src/main alloc.c src/os/os2 os.h util_os2.c Log: OS/2: Fix terminating CGIs that aren't compiled by EMX GCC when a connection is aborted. Revision Changes Path 1.1335 +3 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1334 retrieving revision 1.1335 diff -u -r1.1334 -r1.1335 --- CHANGES 1999/04/29 18:48:52 1.1334 +++ CHANGES 1999/05/01 05:15:49 1.1335 @@ -1,5 +1,8 @@ Changes with Apache 1.3.7 + *) OS/2: Fix terminating CGIs that aren't compiled by EMX GCC when a + connection is aborted. [Brian Havard] + *) Force the LANG envariable to the known state of "C" so that we have assurance about how string manipulators (e.g., tr) will function. [Ken Coar] PR#1630 1.111 +5 -0 apache-1.3/src/main/alloc.c Index: alloc.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/alloc.c,v retrieving revision 1.110 retrieving revision 1.111 diff -u -r1.110 -r1.111 --- alloc.c 1999/04/29 02:04:04 1.110 +++ alloc.c 1999/05/01 05:15:51 1.111 @@ -2673,8 +2673,13 @@ if ((p->kill_how == kill_after_timeout) || (p->kill_how == kill_only_once)) { /* Subprocess may be dead already. Only need the timeout if not. */ +#ifdef OS2 + if (ap_os_kill(p->pid, SIGTERM) != -1) + need_timeout = 1; +#else if (kill(p->pid, SIGTERM) != -1) need_timeout = 1; +#endif } else if (p->kill_how == kill_always) { kill(p->pid, SIGKILL); 1.13 +3 -0 apache-1.3/src/os/os2/os.h Index: os.h =================================================================== RCS file: /home/cvs/apache-1.3/src/os/os2/os.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- os.h 1999/03/07 13:13:55 1.12 +++ os.h 1999/05/01 05:15:52 1.13 @@ -32,6 +32,9 @@ /* FIXME: the following should be implemented on this platform */ #define ap_os_is_filename_valid(f) (1) +/* Use a specialized kill() function */ +int ap_os_kill(int pid, int sig); + /* OS/2 doesn't have symlinks so S_ISLNK is always false */ #define S_ISLNK(m) 0 1.3 +24 -0 apache-1.3/src/os/os2/util_os2.c Index: util_os2.c =================================================================== RCS file: /home/cvs/apache-1.3/src/os/os2/util_os2.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- util_os2.c 1999/02/20 17:57:53 1.2 +++ util_os2.c 1999/05/01 05:15:52 1.3 @@ -1,5 +1,6 @@ #define INCL_DOSFILEMGR #define INCL_DOSERRORS +#define INCL_DOSEXCEPTIONS #include <os2.h> #include "httpd.h" #include "http_log.h" @@ -38,4 +39,27 @@ *pos = '/'; return ap_pstrdup(pPool, buf2); +} + + + +int ap_os_kill(pid_t pid, int sig) +{ +/* SIGTERM's don't work too well in OS/2 (only affects other EMX programs). + CGIs may not be, esp. REXX scripts, so use a native call instead */ + + int rc; + + if ( sig == SIGTERM ) { + rc = DosSendSignalException( pid, XCPT_SIGNAL_BREAK ); + + if ( rc ) { + errno = ESRCH; + rc = -1; + } + } else { + rc = kill(pid, sig); + } + + return rc; }