Attached is a patch that fixes a bug for the accept mutex on the
Cygwin platform. The bug was reported by Sami Tikka
<[EMAIL PROTECTED]> while trying to use multiple Listen directives.

We change the accept mutex from fcntl to pthread, which works even
with several Listen directives set in httpd.conf.

Here are the changes:

  * src/include/ap_config.h: adding HAVE_PTHREAD_SERIALIZED_ACCEPT to
Cygwin block and defaulting to it.

  * src/main/http_main.c: exluding pthread_mutexattr_setpshared() call
for Cygwin platform. This calls seems yet not fully functional on this
platform. Forwarding problem to Cygwin core developers.


Stipe

[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG

Münsterstr. 248
40470 Düsseldorf

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

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
diff -ur apache-1.3/src/include/ap_config.h apache-1.3-cygwin/src/include/ap_config.h
--- apache-1.3/src/include/ap_config.h  Tue Oct  9 19:29:46 2001
+++ apache-1.3-cygwin/src/include/ap_config.h   Tue Jan  1 16:07:48 2002
@@ -1002,7 +1012,11 @@
 #define USE_MMAP_FILES
 #define HAVE_SYSLOG 1
 #define HAVE_FCNTL_SERIALIZED_ACCEPT
+#define HAVE_PTHREAD_SERIALIZED_ACCEPT
 #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
+#if !defined(USE_FNCTL_SERIALIZED_ACCEPT)
+#define USE_PTHREAD_SERIALIZED_ACCEPT
+#endif
 
 
 #else
diff -ur apache-1.3/src/main/http_main.c apache-1.3-cygwin/src/main/http_main.c
--- apache-1.3/src/main/http_main.c     Wed Oct 17 14:45:30 2001
+++ apache-1.3-cygwin/src/main/http_main.c      Tue Jan  1 16:05:19 2002
@@ -662,11 +662,17 @@
        perror("pthread_mutexattr_init");
        exit(APEXIT_INIT);
     }
+    /*
+     * Cygwin has problems with this pthread call claiming that these 
+     * are "Invalid arguements", Stipe Tolj <[EMAIL PROTECTED]>
+     */
+#if !defined(CYGWIN)
     if ((errno = pthread_mutexattr_setpshared(&mattr,
                                                PTHREAD_PROCESS_SHARED))) {
        perror("pthread_mutexattr_setpshared");
        exit(APEXIT_INIT);
     }
+#endif
     if ((errno = pthread_mutex_init(accept_mutex, &mattr))) {
        perror("pthread_mutex_init");
        exit(APEXIT_INIT);

Reply via email to