[master 1/1] Make use of the restore_signals Popen argument

dashea installerbot-noreply at redhat.com
Mon Jun 8 16:05:48 UTC 2015


From: David Shea <dshea at redhat.com>

restore_signals does some, but not all, of what we want with
startProgram's reset_handlers. Make use of the argument to ensure that
reset_handlers=False behaves as expected.
---
 pyanaconda/iutil.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index b9716d5..e8328c1 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -152,6 +152,11 @@ def startProgram(argv, root='/', stdin=None, stdout=subprocess.PIPE, stderr=subp
     # Check for and save a preexec_fn argument
     preexec_fn = kwargs.pop("preexec_fn", None)
 
+    # Map reset_handlers to the restore_signals Popen argument.
+    # restore_signals handles SIGPIPE, and preexec below handles any additional
+    # signals ignored by anaconda.
+    restore_signals = reset_handlers
+
     def preexec():
         # If a target root was specificed, chroot into it
         if target_root and target_root != '/':
@@ -188,6 +193,7 @@ def preexec():
                             stdout=stdout,
                             stderr=stderr,
                             close_fds=True,
+                            restore_signals=restore_signals,
                             preexec_fn=preexec, cwd=root, env=env, **kwargs)
 
 def startX(argv, output_redirect=None):


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/565de7089a1c7c3fbd7ed207dd2365479a179a53


More information about the anaconda-patches mailing list