]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Simplify back to true flag usage of domagic; good catch by Justin.
authorJim Jagielski <jim@apache.org>
Sun, 8 Dec 2002 20:51:43 +0000 (20:51 +0000)
committerJim Jagielski <jim@apache.org>
Sun, 8 Dec 2002 20:51:43 +0000 (20:51 +0000)
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@97799 13f79535-47bb-0310-9956-ffa450edef68

src/main/alloc.c

index 55ebe111364259f6f9aeff1c2e9bd55f10109f2f..e2c9bc4f4205ab2a0b1c6aff515c7b990632433e 100644 (file)
@@ -1813,15 +1813,8 @@ static int fd_magic_cleanup(void *fdv)
 
 API_EXPORT(void) ap_note_cleanups_for_fd_ex(pool *p, int fd, int domagic)
 {
-    if (domagic) {
-        ap_register_cleanup_ex(p, (void *) (long) fd, fd_cleanup, fd_cleanup,
-                        fd_magic_cleanup);
-    } else {
-       /* basically ap_register_cleanup but save the possible
-          overhead of an extraneous function call */
-        ap_register_cleanup_ex(p, (void *) (long) fd, fd_cleanup, fd_cleanup,
-                        NULL);
-    }
+    ap_register_cleanup_ex(p, (void *) (long) fd, fd_cleanup, fd_cleanup,
+                           domagic ? fd_magic_cleanup : NULL);
 }
 
 API_EXPORT(void) ap_note_cleanups_for_fd(pool *p, int fd)
@@ -1915,13 +1908,8 @@ static int file_magic_cleanup(void *fpv)
 
 API_EXPORT(void) ap_note_cleanups_for_file_ex(pool *p, FILE *fp, int domagic)
 {
-    if (domagic) {
-       ap_register_cleanup_ex(p, (void *) fp, file_cleanup, file_child_cleanup,
-                        file_magic_cleanup);
-    } else {
-       ap_register_cleanup_ex(p, (void *) fp, file_cleanup, file_child_cleanup,
-                        NULL);
-    }
+    ap_register_cleanup_ex(p, (void *) fp, file_cleanup, file_child_cleanup,
+                           domagic ? file_magic_cleanup : NULL);
 }
 
 API_EXPORT(void) ap_note_cleanups_for_file(pool *p, FILE *fp)
@@ -2044,13 +2032,9 @@ static int socket_magic_cleanup(void *fpv)
 
 API_EXPORT(void) ap_note_cleanups_for_socket_ex(pool *p, int fd, int domagic)
 {
-    if (domagic) {
-       ap_register_cleanup_ex(p, (void *) (long) fd, socket_cleanup,
-                        socket_cleanup, socket_magic_cleanup);
-    } else {
-       ap_register_cleanup_ex(p, (void *) (long) fd, socket_cleanup,
-                        socket_cleanup, NULL);
-    }
+    ap_register_cleanup_ex(p, (void *) (long) fd, socket_cleanup,
+                           socket_cleanup,
+                           domagic ? socket_magic_cleanup : NULL);
 }
 
 API_EXPORT(void) ap_note_cleanups_for_socket(pool *p, int fd)