OSDN Git Service
(root)
/
uclinux-h8
/
uClibc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58c542d
)
When messing with fd NONBLOCK status, put things back the way we found
author
Eric Andersen
<andersen@codepoet.org>
Mon, 25 Feb 2002 15:06:10 +0000
(15:06 -0000)
committer
Eric Andersen
<andersen@codepoet.org>
Mon, 25 Feb 2002 15:06:10 +0000
(15:06 -0000)
them afterwards. As was, this hosed things up for fds shared with a
parent process. Very bad for shells... Oops.
-Erik
libc/stdio/stdio.c
patch
|
blob
|
history
diff --git
a/libc/stdio/stdio.c
b/libc/stdio/stdio.c
index
3f475ae
..
63fb6bd
100644
(file)
--- a/
libc/stdio/stdio.c
+++ b/
libc/stdio/stdio.c
@@
-203,8
+203,11
@@
void __stdio_flush_buffers(void)
if (WRITEABLE(fp)) {
/* Set the underlying fd to non-block mode to ensure
* that calls to _exit() and abort() will not block */
- fcntl(fp->fd, F_SETFL, O_NONBLOCK);
+ long flags;
+ fcntl(fp->fd, F_GETFL, &flags);
+ fcntl(fp->fd, F_SETFL, flags|O_NONBLOCK);
fflush(fp);
+ fcntl(fp->fd, F_SETFL, flags);
}
}
}