]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1858] explicitly set close_fds to True in sockcreator's Popen().
authorJINMEI Tatuya <jinmei@isc.org>
Thu, 11 Oct 2012 21:03:58 +0000 (14:03 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Thu, 11 Oct 2012 21:03:58 +0000 (14:03 -0700)
src/lib/python/isc/bind10/sockcreator.py

index c681d07feee2e778f5d2ee7874720a60eca4f33e..55142eeda4fe3a50c4a8d12c1b4a3b4978468b5e 100644 (file)
@@ -214,9 +214,14 @@ class Creator(Parser):
                                 socket.SOCK_STREAM)
         env = copy.deepcopy(os.environ)
         env['PATH'] = path
+        # We explicitly set close_fs to True; it's False by default before
+        # Python 3.2.  If we don't close the remaining FDs, the copy of
+        # 'local' will prevent the child process from terminating when
+        # the parent process died abruptly.
         self.__process = subprocess.Popen(['b10-sockcreator'], env=env,
                                           stdin=remote.fileno(),
                                           stdout=remote2.fileno(),
+                                          close_fds=True,
                                           preexec_fn=self.__preexec_work)
         remote.close()
         remote2.close()