]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Ignore SIGPIPE when we've opened a pipe
authorGuido van Rossum <guido@python.org>
Sat, 27 Jul 1991 21:41:01 +0000 (21:41 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 27 Jul 1991 21:41:01 +0000 (21:41 +0000)
Modules/posixmodule.c

index 7645bfda3fc5c9ba90185cba622e4f68a4bba820..204918be4982706ac12245e657eef96931c36b40 100644 (file)
@@ -571,6 +571,9 @@ posix_popen(self, args)
        fp = popen(getstringvalue(name), getstringvalue(mode));
        if (fp == NULL)
                return posix_error();
+       /* From now on, ignore SIGPIPE and let the error checking
+          do the work. */
+       (void) signal(SIGPIPE, SIG_IGN);
        return newopenfileobject(fp, name, mode, pclose);
 }