diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2012-05-10 15:06:11 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-05-10 15:06:11 -0700 |
commit | 3fbfc5e0f7024e14bb9a1b4d095d0e5a342753d4 (patch) | |
tree | 542c682d8fdb72e53aba0c50263df6a23ca27b7c | |
parent | 54c51a9c23876b292231608d01b85ebbb2cc976c (diff) | |
download | klibc-3fbfc5e0f7024e14bb9a1b4d095d0e5a342753d4.tar.gz |
[klibc] Fix confusion between _IONBF and _IOFBF
_IONBF and _IOFBF were swapped in several places.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | usr/klibc/stdio/fwrite.c | 4 | ||||
-rw-r--r-- | usr/klibc/stdio/fxopen.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/usr/klibc/stdio/fwrite.c b/usr/klibc/stdio/fwrite.c index 1782b97b5e145..38e715200fe5d 100644 --- a/usr/klibc/stdio/fwrite.c +++ b/usr/klibc/stdio/fwrite.c @@ -70,7 +70,7 @@ size_t _fwrite(const void *buf, size_t count, FILE *file) and contents. */ switch (f->bufmode) { - case _IONBF: + case _IOFBF: pf_len = 0; pu_len = count; break; @@ -85,7 +85,7 @@ size_t _fwrite(const void *buf, size_t count, FILE *file) } break; - case _IOFBF: + case _IONBF: default: pf_len = 0; pu_len = count; diff --git a/usr/klibc/stdio/fxopen.c b/usr/klibc/stdio/fxopen.c index dcc45f11e9424..cc11f346cec86 100644 --- a/usr/klibc/stdio/fxopen.c +++ b/usr/klibc/stdio/fxopen.c @@ -31,7 +31,7 @@ FILE *__fxopen(int fd, int flags, bool close_on_err) f->pub._io_filepos = lseek(fd, 0, SEEK_CUR); f->bufsiz = BUFSIZ; f->data = f->buf + _IO_UNGET_SLOP; - f->bufmode = isatty(fd) ? _IOLBF : _IONBF; + f->bufmode = isatty(fd) ? _IOLBF : _IOFBF; /* Insert into linked list */ f->prev = &__stdio_headnode; |