_MergeProcess: use default SIGINT/TERM handlers
authorZac Medico <zmedico@gentoo.org>
Tue, 1 Feb 2011 04:42:46 +0000 (20:42 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 1 Feb 2011 04:42:46 +0000 (20:42 -0800)
Signal handlers inherited from the parent process are irrelevant here.

pym/portage/dbapi/_MergeProcess.py

index 3cf50d22bd7db7978044af0ac04f261f106fa861..f717d12df81b5bc7ca513cafee26afcc5d63daa1 100644 (file)
@@ -1,6 +1,7 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import signal
 import traceback
 
 import portage
@@ -29,6 +30,11 @@ class MergeProcess(SpawnProcess):
 
                portage.process._setup_pipes(fd_pipes)
 
+               # Use default signal handlers since the ones inherited
+               # from the parent process are irrelevant here.
+               signal.signal(signal.SIGINT, signal.SIG_DFL)
+               signal.signal(signal.SIGTERM, signal.SIG_DFL)
+
                portage.output.havecolor = self.dblink.settings.get('NOCOLOR') \
                        not in ('yes', 'true')