X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpipe.c;h=b68a555ea517f6abe81e9fc64803ecd62a08c411;hb=e8ed2e7ddefb834cecd84c10d7b02697631cbb0a;hp=eff66cfa5de9954cc059ebb1ce3bbdb0840df458;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/pipe.c b/lib/pipe.c index eff66cfa5..b68a555ea 100644 --- a/lib/pipe.c +++ b/lib/pipe.c @@ -32,7 +32,16 @@ int pipe (int fd[2]) { - return _pipe (fd, 4096, _O_BINARY); + /* Mingw changes fd to {-1,-1} on failure, but this violates + http://austingroupbugs.net/view.php?id=467 */ + int tmp[2]; + int result = _pipe (tmp, 4096, _O_BINARY); + if (!result) + { + fd[0] = tmp[0]; + fd[1] = tmp[1]; + } + return result; } #else