'If a child process exits while a system call is in progress, the system
call should not be interfered with.  In particular, it should not fail
with EINTR.
Older versions of Twisted installed a SIGCHLD handler on POSIX without
using the feature exposed by the SA_RESTART flag to sigaction(2).  The
most noticeable problem this caused was for blocking reads and writes to
sometimes fail with EINTR.'

def test_systemCallUninterruptedByChildExit(self):

    reactor = self.buildReactor()
    result = []
    def f():
        try:
            exe = pyExe.decode(sys.getfilesystemencoding())
            subprocess.Popen([exe, '-c', 'import    time;    time.sleep(0.1)'])
            f2 = subprocess.Popen([exe, '-c', "import    time;    time.sleep(0.5);print('Foo')"], stdout=subprocess.PIPE)
            with f2.stdout:
                result.append(f2.stdout.read())
        finally:
            reactor.stop()
    reactor.callWhenRunning(f)
    self.runReactor(reactor)
    self.assertEqual(result, [('Foo' + os.linesep.encode('ascii'))])
