Doh! New patch (flag should have been flags).
Brian
On Mar 21, 2007, at 10:31 AM, Brian J. France wrote:
Here is a patch that makes apr_file_mktemp check for the
APR_FILE_NOCLEANUP flag and not register a cleanup passed in.
APR_FILE_NOCLEANUP is being used in other places, but
APR_FOPEN_NOCLEANUP might be a better choice.
Brian
Index: mktemp.c
===================================================================
--- mktemp.c (revision 520899)
+++ mktemp.c (working copy)
@@ -202,8 +202,10 @@
apr_os_file_put(fp, &fd, flags, p);
(*fp)->fname = apr_pstrdup(p, template);
- apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
- apr_unix_file_cleanup,
apr_unix_file_cleanup);
+ if (!(flags & APR_FILE_NOCLEANUP)) {
+ apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
+ apr_unix_file_cleanup,
apr_unix_file_cleanup);
+ }
#endif
return APR_SUCCESS;
}