]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixes issue #8052: The posix subprocess module's close_fds behavior was
authorGregory P. Smith <greg@krypto.org>
Sat, 21 Jan 2012 22:39:29 +0000 (14:39 -0800)
committerGregory P. Smith <greg@krypto.org>
Sat, 21 Jan 2012 22:39:29 +0000 (14:39 -0800)
suboptimal by closing all possible file descriptors rather than just
the open ones in the child process before exec().

It now closes only the open fds when it is possible to safely determine what
those are.

1  2 
Lib/test/test_subprocess.py
Modules/_posixsubprocess.c
configure
configure.in
pyconfig.h.in

Simple merge
Simple merge
diff --cc configure
index d6bd2bf6dee23cd78ae527e673d376b1904ead08,b95e0a3f0f1c7a586bd7e2a21e38f95b5736023e..10ee46ca570b6c60f94f46b9c1d90503a5e2973c
+++ b/configure
  
  for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
  fcntl.h grp.h \
 -ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
 -shadow.h signal.h stdint.h stropts.h termios.h thread.h \
 +ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \
 +sched.h shadow.h signal.h stdint.h stropts.h termios.h \
  unistd.h utime.h \
 -sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
 +poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
 +sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/loadavg.h \
  sys/lock.h sys/mkdev.h sys/modem.h \
 -sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
 -sys/syscall.h sys/termio.h sys/time.h \
 -sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
 -sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 +sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
- sys/stat.h sys/termio.h sys/time.h \
++sys/stat.h sys/syscall.h sys/termio.h sys/time.h \
 +sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
 +libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
  bluetooth/bluetooth.h linux/tipc.h spawn.h util.h
  do :
    as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
diff --cc configure.in
index fd70d251977ded1b4b5d476d1e813cee90368df9,71e0a8f2de390606ade7397bbbc34c708d4a54bb..0aa094a80f3fc6c6e13e03bd6ce3e7ac94c6847d
@@@ -1330,16 -1335,15 +1330,16 @@@ dnl AC_MSG_RESULT($cpp_type
  AC_HEADER_STDC
  AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
  fcntl.h grp.h \
 -ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
 -shadow.h signal.h stdint.h stropts.h termios.h thread.h \
 +ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \
 +sched.h shadow.h signal.h stdint.h stropts.h termios.h \
  unistd.h utime.h \
 -sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
 +poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
 +sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/loadavg.h \
  sys/lock.h sys/mkdev.h sys/modem.h \
 -sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
 -sys/syscall.h sys/termio.h sys/time.h \
 -sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
 -sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
 +sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
- sys/stat.h sys/termio.h sys/time.h \
++sys/stat.h sys/syscall.h sys/termio.h sys/time.h \
 +sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
 +libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
  bluetooth/bluetooth.h linux/tipc.h spawn.h util.h)
  AC_HEADER_DIRENT
  AC_HEADER_MAJOR
diff --cc pyconfig.h.in
Simple merge