Author: randyk
Date: Wed Aug 2 19:56:24 2006
New Revision: 428216
URL: http://svn.apache.org/viewvc?rev=428216&view=rev
Log:
add APR_FILE_NOCLEANUP | APR_SHARELOCK to flags
passed to apreq_file_mktemp() on Win32 in
library/util.c, in order to clean up occasional
stray temp files left behind in the
Perl upload test (reported by Steve Hay)
Modified:
httpd/apreq/trunk/CHANGES
httpd/apreq/trunk/library/util.c
Modified: httpd/apreq/trunk/CHANGES
URL:
http://svn.apache.org/viewvc/httpd/apreq/trunk/CHANGES?rev=428216&r1=428215&r2=428216&view=diff
==============================================================================
--- httpd/apreq/trunk/CHANGES (original)
+++ httpd/apreq/trunk/CHANGES Wed Aug 2 19:56:24 2006
@@ -4,6 +4,12 @@
@section v2_08 Changes with libapreq2-2.08 (under development)
+- Perl API [Randy Kobes]
+ add APR_FILE_NOCLEANUP | APR_SHARELOCK to flags passed to
+ apreq_file_mktemp() on Win32 in library/util.c, in order to
+ clean up occasional stray temp files left behind in the
+ Perl upload test (reported by Steve Hay)
+
- Build [Philip M. Gollucci, Bojan Smojver, joes]
add -fno-strict-aliasing to all compiles on all systems
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=193740
Modified: httpd/apreq/trunk/library/util.c
URL:
http://svn.apache.org/viewvc/httpd/apreq/trunk/library/util.c?rev=428216&r1=428215&r2=428216&view=diff
==============================================================================
--- httpd/apreq/trunk/library/util.c (original)
+++ httpd/apreq/trunk/library/util.c Wed Aug 2 19:56:24 2006
@@ -811,6 +811,7 @@
apr_status_t rc;
char *tmpl;
struct cleanup_data *data;
+ apr_int32_t flag;
if (path == NULL) {
rc = apr_temp_dir_get(&path, pool);
@@ -829,9 +830,17 @@
apr_pool_cleanup_register(pool, data,
apreq_file_cleanup, apreq_file_cleanup);
- rc = apr_file_mktemp(fp, tmpl, /* NO APR_DELONCLOSE! see comment above */
- APR_CREATE | APR_READ | APR_WRITE
- | APR_EXCL | APR_BINARY, pool);
+ /* NO APR_DELONCLOSE! see comment above */
+ flag = APR_CREATE | APR_READ | APR_WRITE | APR_EXCL | APR_BINARY;
+ /* Win32 needs the following to remove temp files.
+ * XXX: figure out why the APR_SHARELOCK flag works;
+ * a grep through the httpd sources seems to indicate
+ * it's only used in sdbm files??
+ */
+#ifdef WIN32
+ flag |= APR_FILE_NOCLEANUP | APR_SHARELOCK;
+#endif
+ rc = apr_file_mktemp(fp, tmpl, flag, pool);
if (rc == APR_SUCCESS) {
apr_file_name_get(&data->fname, *fp);