apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r543555 - in /apr/apr/trunk/file_io: netware/mktemp.c unix/mktemp.c
Date Fri, 01 Jun 2007 17:58:05 GMT
Author: wrowe
Date: Fri Jun  1 10:58:04 2007
New Revision: 543555

URL: http://svn.apache.org/viewvc?view=rev&rev=543555
Log:
Register a cleanup only if APR_FILE_NOCLEANUP was not flagged.

Submitted by: Brian J. France <list firehawksystems.com>
Reviewed by: wrowe, bojan

Modified:
    apr/apr/trunk/file_io/netware/mktemp.c
    apr/apr/trunk/file_io/unix/mktemp.c

Modified: apr/apr/trunk/file_io/netware/mktemp.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/netware/mktemp.c?view=diff&rev=543555&r1=543554&r2=543555
==============================================================================
--- apr/apr/trunk/file_io/netware/mktemp.c (original)
+++ apr/apr/trunk/file_io/netware/mktemp.c Fri Jun  1 10:58:04 2007
@@ -41,9 +41,12 @@
     if ((rv = apr_file_open(fp, template, flags|APR_FILE_NOCLEANUP,
                             APR_UREAD | APR_UWRITE, p)) == APR_SUCCESS) {
 
-        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);
+	}
     }
 
     return rv;

Modified: apr/apr/trunk/file_io/unix/mktemp.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/unix/mktemp.c?view=diff&rev=543555&r1=543554&r2=543555
==============================================================================
--- apr/apr/trunk/file_io/unix/mktemp.c (original)
+++ apr/apr/trunk/file_io/unix/mktemp.c Fri Jun  1 10:58:04 2007
@@ -202,9 +202,11 @@
     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;
 }



Mime
View raw message