summaryrefslogtreecommitdiff
path: root/file_io/unix
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2007-06-01 17:58:04 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2007-06-01 17:58:04 +0000
commit795a5af5aa0a712f8c60f47300864029eaa4ebdb (patch)
treeeb33ef073c3e48247fb1ebe4dc3aa0938314e751 /file_io/unix
parent75dc941c443c21e28f7ff20adc09bbf77df4509f (diff)
downloadlibapr-795a5af5aa0a712f8c60f47300864029eaa4ebdb.tar.gz
Register a cleanup only if APR_FILE_NOCLEANUP was not flagged.
Submitted by: Brian J. France <list firehawksystems.com> Reviewed by: wrowe, bojan git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@543555 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/unix')
-rw-r--r--file_io/unix/mktemp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c
index 8ac2f91bf..22e0bd5d3 100644
--- a/file_io/unix/mktemp.c
+++ b/file_io/unix/mktemp.c
@@ -202,9 +202,11 @@ APR_DECLARE(apr_status_t) apr_file_mktemp(apr_file_t **fp, char *template, apr_i
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_child_file_cleanup);
+ if (!(flags & APR_FILE_NOCLEANUP)) {
+ apr_pool_cleanup_register((*fp)->pool, (void *)(*fp),
+ apr_unix_file_cleanup,
+ apr_unix_child_file_cleanup);
+ }
#endif
return APR_SUCCESS;
}