You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Brian Hirt <bh...@mobygames.com> on 2003/09/25 21:03:31 UTC

[libapreq] could not create/open temp file

all of a sudden i'm getting '[libapreq] could not create/open temp 
file'.   Searching on google, i came across a patch stan posted  to 
give a more meaningful error message, but somehow it never made it into 
the CVS tree.  (i've got libapreq1.2 installed)

here was the old patch.   anyway, it would be nice if this was 
incorporated into the real source code, it would have made finding the 
problem much easier/quicker.

Index: c/apache_request.c
===================================================================
RCS file: /home/cvs/httpd-apreq/c/apache_request.c,v
retrieving revision 1.20
diff -u -r1.20 apache_request.c
--- c/apache_request.c  18 Feb 2002 16:48:27 -0000      1.20
+++ c/apache_request.c  8 Jun 2002 04:41:08 -0000
@@ -359,7 +359,9 @@
       }

       if ( tries == 0  || (fp = ap_pfdopen(r->pool, fd, "w+" "b") ) ==
NULL ) {
-
ap_log_rerror(REQ_ERROR, "[libapreq] could not create/open temp file");
+
ap_log_rerror(REQ_ERROR,
+                      "[libapreq] could not create/open temp file: %s",
+                      strerror(errno));
         if ( fd >= 0 ) { remove(name); free(name); }
         return NULL;
       }

Index: c/apache_request.h
===================================================================
RCS file: /home/cvs/httpd-apreq/c/apache_request.h,v
retrieving revision 1.8
diff -u -r1.8 apache_request.h
--- c/apache_request.h  26 Jun 2001 10:58:29 -0000      1.8
+++ c/apache_request.h  8 Jun 2002 04:41:08 -0000
@@ -9,6 +9,7 @@
   #include "http_main.h"
   #include "http_protocol.h"
   #include "util_script.h"
+#include <string.h>

   #ifdef  SFIO
   #include "sfio.h" 

Re: [libapreq] could not create/open temp file

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Brian Hirt <bh...@mobygames.com> writes:

> all of a sudden i'm getting '[libapreq] could not create/open temp
> file'. Searching on google, i came across a patch stan posted to give
> a more meaningful error message, but somehow it never made it into the
> CVS tree. (i've got libapreq1.2 installed)

Thanks for the reminder!  I rolled 1.3_rc1 earlier today, so does
anybody mind if I include the following patch in 1.3_rc2?

Index: c/apache_request.c
===================================================================
RCS file: /home/cvs/httpd-apreq/c/apache_request.c,v
retrieving revision 1.26
diff -u -r1.26 apache_request.c
--- c/apache_request.c	12 Jul 2003 17:42:00 -0000	1.26
+++ c/apache_request.c	25 Sep 2003 19:44:47 -0000
@@ -56,6 +56,8 @@
  * University of Illinois, Urbana-Champaign.
  */
 
+#include <errno.h>
+#include <string.h>
 #include "apache_request.h"
 #include "apache_multipart_buffer.h"
 int fill_buffer(multipart_buffer *self); /* needed for mozilla hack */
@@ -491,7 +493,9 @@
     }
 
     if ( tries == 0  || (fp = ap_pfdopen(r->pool, fd, "w+" "b") ) == NULL ) {
-	ap_log_rerror(REQ_ERROR, "[libapreq] could not create/open temp file");
+	ap_log_rerror(REQ_ERROR, 
+                      "[libapreq] could not create/open temp file: %s",
+                      strerror(errno));
 	if ( fd >= 0 ) { remove(name); free(name); }
 	return NULL;
     }


-- 
Joe Schaefer