diff -ruN mod_fcgid.orig/files/patch-modules-fcgid-fcgid_bridge.c mod_fcgid/files/patch-modules-fcgid-fcgid_bridge.c --- mod_fcgid.orig/files/patch-modules-fcgid-fcgid_bridge.c 1970-01-01 03:00:00.000000000 +0300 +++ mod_fcgid/files/patch-modules-fcgid-fcgid_bridge.c 2010-01-13 23:16:36.000000000 +0200 @@ -0,0 +1,39 @@ +--- ./modules/fcgid/fcgid_bridge.c.orig 2009-10-07 14:37:11.000000000 +0300 ++++ ./modules/fcgid/fcgid_bridge.c 2010-01-13 23:15:11.000000000 +0200 +@@ -448,7 +448,6 @@ + int seen_eos; + apr_off_t request_size = 0; + apr_file_t *fd = NULL; +- int need_truncate = 1; + apr_off_t cur_pos = 0; + FCGI_Header *stdin_request_header; + apr_bucket_brigade *output_brigade; +@@ -548,6 +547,15 @@ + apr_pool_userdata_get(&tmp, fd_key, + r->connection->pool); + fd = tmp; ++ ++ if (fd != NULL) { ++ if ((rv = apr_file_trunc(fd, 0)) != APR_SUCCESS) { ++ ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, ++ "mod_fcgid: can't truncate existing " ++ "temporary file"); ++ return HTTP_INTERNAL_SERVER_ERROR; ++ } ++ } + } + + if (fd == NULL) { +@@ -574,11 +582,8 @@ + apr_pool_userdata_set((const void *) fd, fd_key, + apr_pool_cleanup_null, + r->connection->pool); +- } else if (need_truncate) { +- need_truncate = 0; +- apr_file_trunc(fd, 0); +- cur_pos = 0; + } ++ + // Write request to tmp file + if ((rv = + apr_file_write_full(fd, (const void *) data, len,