projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
strtoumax: fix typo in previous commit.
[gnulib.git]
/
lib
/
pipe.c
diff --git
a/lib/pipe.c
b/lib/pipe.c
index
e002ad2
..
988fd86
100644
(file)
--- a/
lib/pipe.c
+++ b/
lib/pipe.c
@@
-1,5
+1,5
@@
/* Create a pipe.
/* Create a pipe.
- Copyright (C) 2009-201
0
Free Software Foundation, Inc.
+ Copyright (C) 2009-201
3
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-12,8
+12,7
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <config.h>
@@
-21,7
+20,7
@@
#include <unistd.h>
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
#include <unistd.h>
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Native W
oe32
API. */
+/* Native W
indows
API. */
/* Get _pipe(). */
# include <io.h>
/* Get _pipe(). */
# include <io.h>
@@
-32,7
+31,16
@@
int
pipe (int fd[2])
{
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
}
#else