Index: fusl/src/stdio/__fdopen.c |
diff --git a/fusl/src/stdio/__fdopen.c b/fusl/src/stdio/__fdopen.c |
index 3a62f30bbf237879d50c51b14942ed47c516c7f1..eb72928708db8db730b016db89f88ffa8855fbd7 100644 |
--- a/fusl/src/stdio/__fdopen.c |
+++ b/fusl/src/stdio/__fdopen.c |
@@ -1,13 +1,12 @@ |
#include "stdio_impl.h" |
#include <stdlib.h> |
-#include <sys/ioctl.h> |
#include <fcntl.h> |
#include <errno.h> |
#include <string.h> |
+#include <unistd.h> |
FILE* __fdopen(int fd, const char* mode) { |
FILE* f; |
- struct winsize wsz; |
/* Check for valid initial mode character */ |
if (!strchr("rwa", *mode)) { |
@@ -44,7 +43,7 @@ FILE* __fdopen(int fd, const char* mode) { |
/* Activate line buffered mode for terminals */ |
f->lbf = EOF; |
- if (!(f->flags & F_NOWR) && !__syscall(SYS_ioctl, fd, TIOCGWINSZ, &wsz)) |
+ if (!(f->flags & F_NOWR) && isatty(fd)) |
f->lbf = '\n'; |
/* Initialize op ptrs. No problem if some are unneeded. */ |