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
27089d6d
Commit
27089d6d
authored
Aug 23, 2009
by
Bruno Haible
Browse files
Fix test of fcntl's return value.
parent
c7054c79
Changes
3
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
27089d6d
2009-08-22 Bruno Haible <bruno@clisp.org>
* lib/pipe-filter-ii.c (pipe_filter_ii_execute): Fix test of fcntl's
return value.
* lib/pipe-filter-gi.c (filter_init): Likewise.
Reported by Eric Blake.
2009-08-22 Bruno Haible <bruno@clisp.org>
* lib/pipe.c (create_pipe): Use pipe2 instead of _pipe.
lib/pipe-filter-gi.c
View file @
27089d6d
...
...
@@ -248,9 +248,9 @@ filter_init (struct pipe_filter_gi *filter)
int
fcntl_flags
;
if
((
fcntl_flags
=
fcntl
(
filter
->
fd
[
1
],
F_GETFL
,
0
))
<
0
||
fcntl
(
filter
->
fd
[
1
],
F_SETFL
,
fcntl_flags
|
O_NONBLOCK
)
<
0
||
fcntl
(
filter
->
fd
[
1
],
F_SETFL
,
fcntl_flags
|
O_NONBLOCK
)
==
-
1
||
(
fcntl_flags
=
fcntl
(
filter
->
fd
[
0
],
F_GETFL
,
0
))
<
0
||
fcntl
(
filter
->
fd
[
0
],
F_SETFL
,
fcntl_flags
|
O_NONBLOCK
)
<
0
)
||
fcntl
(
filter
->
fd
[
0
],
F_SETFL
,
fcntl_flags
|
O_NONBLOCK
)
==
-
1
)
{
if
(
filter
->
exit_on_error
)
error
(
EXIT_FAILURE
,
errno
,
...
...
lib/pipe-filter-ii.c
View file @
27089d6d
...
...
@@ -289,9 +289,9 @@ pipe_filter_ii_execute (const char *progname,
int
fcntl_flags
;
if
((
fcntl_flags
=
fcntl
(
fd
[
1
],
F_GETFL
,
0
))
<
0
||
fcntl
(
fd
[
1
],
F_SETFL
,
fcntl_flags
|
O_NONBLOCK
)
<
0
||
fcntl
(
fd
[
1
],
F_SETFL
,
fcntl_flags
|
O_NONBLOCK
)
==
-
1
||
(
fcntl_flags
=
fcntl
(
fd
[
0
],
F_GETFL
,
0
))
<
0
||
fcntl
(
fd
[
0
],
F_SETFL
,
fcntl_flags
|
O_NONBLOCK
)
<
0
)
||
fcntl
(
fd
[
0
],
F_SETFL
,
fcntl_flags
|
O_NONBLOCK
)
==
-
1
)
{
if
(
exit_on_error
)
error
(
EXIT_FAILURE
,
errno
,
...
...
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