[PATCH] mod_fastcgi.c struct timeval initialization on 64bit MVS

"Eric Covener" <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
When building a 64-bit mod_fastcgi for apache2 on MVS, there is a
problematic initialization of struct timeval (the 64-bit definition
has a padding field in the middle, so the value intended tv_usec isn't
used)

This causes select() to return right away, and dynamic applications
can cause a internal server error.

Patch attached, after applying select works as expected on 64 bit MVS
and dynamic apps are more reliable

-- 
Eric Covener
[email protected]

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
fastcgi-timeval.diff (text/plain, 818 B)
--- fastcgi-old/mod_fastcgi.c   2006-05-17 19:39:22.000000000 -0700
+++ fastcgi/mod_fastcgi.c       2006-05-17 19:39:29.000000000 -0700
@@ -1124,7 +1124,9 @@
 #endif
                     {
 #ifndef WIN32
-                        struct timeval tv = {1, 0};
+                        struct timeval tv = {0};
+                        tv.tv_sec = 1;
+                        tv.tv_usec = 0;
 #endif
                         /*
                          * There's a newer one, request a restart.
@@ -1161,7 +1163,8 @@

                 if (fr->fs && fr->fs->restartTime)
 #else
-                struct timeval tv = {0, 500000};
+                struct timeval tv = {0};
+                tv.tv_usec =  500000;

                 /* Avoid sleep/alarm interactions */
                 ap_select(0, NULL, NULL, NULL, &tv);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.