Bug #309001 - Install a SIGPIPE handler inside _exec for all forked processes.
authorZac Medico <zmedico@gentoo.org>
Sat, 13 Mar 2010 06:47:36 +0000 (06:47 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 13 Mar 2010 06:47:36 +0000 (06:47 -0000)
svn path=/main/trunk/; revision=15825

pym/portage/process.py

index e7f09cd2d212a5c37b10a17746a0ad1b5b77ec0c..703e7cc9f0acadfa9187a800381e8f4307ae5c86 100644 (file)
@@ -343,6 +343,9 @@ def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask,
        myargs = [opt_name]
        myargs.extend(mycommand[1:])
 
+       # Quiet killing of subprocesses by SIGPIPE (see bug #309001).
+       signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
        # Set up the command's pipes.
        my_fds = {}
        # To protect from cases where direct assignment could