Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 1777 invoked by uid 500); 8 Dec 2002 20:00:38 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 1762 invoked from network); 8 Dec 2002 20:00:38 -0000 Date: Sun, 08 Dec 2002 12:00:39 -0800 From: Justin Erenkrantz Reply-To: Justin Erenkrantz To: dev@httpd.apache.org Subject: Re: cvs commit: apache-1.3/src/main alloc.c http_log.c Message-ID: <2147483647.1039348839@[10.0.1.20]> In-Reply-To: <20021208190955.60154.qmail@icarus.apache.org> References: <20021208190955.60154.qmail@icarus.apache.org> X-Mailer: Mulberry/3.0.0 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Status: No, hits=-2.5 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES version=2.50-cvs X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --On Sunday, December 8, 2002 7:09 PM +0000 jim@apache.org wrote: > @@ -1691,6 +1693,18 @@ > c->child_cleanup = child_cleanup; > c->next = p->cleanups; > p->cleanups = c; > + if(magic_cleanup) { > + if(!magic_cleanup(data)) > + ap_log_error(APLOG_MARK, APLOG_WARNING, NULL, > + "exec() may not be safe"); > + } > +} Your editor seems to have been tab-happy. > +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); > + } > +} Would it be better to simplify as: ap_register_cleanup_ex(p, (void *) (long) fd, fd_cleanup, fd_cleanup, domagic ? fd_magic_cleanup : NULL); (Appears several other places, too.) > API_EXPORT(void) ap_kill_cleanups_for_socket(pool *p, int sock) > @@ -2603,19 +2681,19 @@ > > if (pipe_out) { > *pipe_out = ap_bcreate(p, B_RD); > - ap_note_cleanups_for_fd(p, fd_out); > + ap_note_cleanups_for_fd_ex(p, fd_out, 0); Why switch this? Wouldn't it have been the same thing, or are you trying to save extra function calls whereever possible? -- justin