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:
12eb7ca
)
Sometimes (often) the kernel will return things other then -1.
author
Eric Andersen
<andersen@codepoet.org>
Tue, 29 May 2001 17:43:46 +0000
(17:43 -0000)
committer
Eric Andersen
<andersen@codepoet.org>
Tue, 29 May 2001 17:43:46 +0000
(17:43 -0000)
Deal with it.
-Erik
libc/termios/termios.c
patch
|
blob
|
history
diff --git
a/libc/termios/termios.c
b/libc/termios/termios.c
index
d6cd124
..
e0c3743
100644
(file)
--- a/
libc/termios/termios.c
+++ b/
libc/termios/termios.c
@@
-35,14
+35,13
@@
int isatty(int fd)
{
-
struct __kernel_termios k_term;
+ struct __kernel_termios k_term;
- /*
- * When ioctl returns -1 we want to return 0 and
- * when ioctl returns 0 we want to return 1.
- * Incrementing is cheaper (size & speed) than a test.
- */
- return ioctl(fd, TCGETS, &k_term) + 1;
+ /*
+ * When ioctl returns -1 we want to return 0 and
+ * when ioctl returns 0 we want to return 1.
+ */
+ return (ioctl(fd, TCGETS, &k_term)==0)? 1 : 0;
}
#endif