projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6ef5d06
)
Support O_TEXT, O_BINARY on all platforms.
author
Bruno Haible
<bruno@clisp.org>
Sun, 23 Aug 2009 08:46:39 +0000
(10:46 +0200)
committer
Bruno Haible
<bruno@clisp.org>
Sun, 23 Aug 2009 08:46:39 +0000
(10:46 +0200)
ChangeLog
patch
|
blob
|
history
lib/pipe2.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index 868272b551eea51828b46d9a5d52250c367ac4b4..ee8dd55cd933f74f09c0a524ac251267c03a2d9f 100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,6
+1,12
@@
+2009-08-23 Bruno Haible <bruno@clisp.org>
+
+ * lib/pipe2.c (pipe2): Support O_TEXT, O_BINARY on all platforms.
+ Reported by Eric Blake.
+
2009-08-23 Bruno Haible <bruno@clisp.org>
* lib/pipe2.c (pipe2): Fix test of fcntl's return value.
2009-08-23 Bruno Haible <bruno@clisp.org>
* lib/pipe2.c (pipe2): Fix test of fcntl's return value.
+ Reported by Eric Blake.
2009-08-23 Bruno Haible <bruno@clisp.org>
2009-08-23 Bruno Haible <bruno@clisp.org>
diff --git
a/lib/pipe2.c
b/lib/pipe2.c
index d40c4cda8e8d6f88b71b1309b47727ed5ead0231..805c3f560f1cec85a64b9eb232e4c60ddce87c6d 100644
(file)
--- a/
lib/pipe2.c
+++ b/
lib/pipe2.c
@@
-52,7
+52,7
@@
int
pipe2 (int fd[2], int flags)
{
/* Check the supported flags. */
pipe2 (int fd[2], int flags)
{
/* Check the supported flags. */
- if ((flags & ~(O_CLOEXEC | O_NONBLOCK)) != 0)
+ if ((flags & ~(O_CLOEXEC | O_NONBLOCK
| O_TEXT | O_BINARY
)) != 0)
{
errno = EINVAL;
return -1;
{
errno = EINVAL;
return -1;
@@
-87,6
+87,13
@@
pipe2 (int fd[2], int flags)
goto fail;
}
goto fail;
}
+#if O_BINARY
+ if (flags & O_BINARY)
+ setmode (fd, O_BINARY);
+ else if (flags & O_TEXT)
+ setmode (fd, O_TEXT);
+#endif
+
return 0;
fail:
return 0;
fail: