Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tarot
gnulib
Commits
1a661ca2
Commit
1a661ca2
authored
Aug 23, 2009
by
Bruno Haible
Browse files
Support O_TEXT, O_BINARY on all platforms.
parent
6ef5d068
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
1a661ca2
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.
Reported by Eric Blake.
2009-08-23 Bruno Haible <bruno@clisp.org>
lib/pipe2.c
View file @
1a661ca2
...
...
@@ -52,7 +52,7 @@ int
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
;
...
...
@@ -87,6 +87,13 @@ pipe2 (int fd[2], int flags)
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:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment