apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46425] Apr should set FD_CLOEXEC if APR_FOPEN_NOCLEANUP is not set
Date Sun, 21 Dec 2008 14:04:35 GMT

--- Comment #1 from Stefan Fritsch <sf@sfritsch.de>  2008-12-21 06:04:35 PST ---
Created an attachment (id=23045)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23045)
Patch for trunk to set FD_CLOEXEC

Here is a patch that sets FD_CLOEXEC when a fd is not inheritable. This has the
following caveats:

- I don't use any of the new APIs (O_CLOEXEC, SOCK_CLOEXEC, ...) because I
  haven't checked what happens if apr is compiled on a system with O_CLOEXEC
  and then is used on a system without O_CLOEXEC.

- For the pollsets, I have only changed epoll so far. Changing the other
  implementations should be straightforward, though.

- I have only dealt with unix (don't know if windows and os2 have something
  like FD_CLOEXEC).

- If this patch is used with apache+mod_php, a program that is called by e.g.
  php's passthru() won't have stderr because the error log is not opened with
  APR_FOPEN_NOCLEANUP.  Maybe apache should set this flag on its error log.
  Or mod_php should take care to provide stderr for its children.

Before I spend more time on this, I would like to know if this approach has
chances of being integrated.

Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org

View raw message