diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-11-24 17:15:43 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-11-24 17:15:43 +0000 |
commit | 14773e10a01ea162bb305975a4d439c52a620876 (patch) | |
tree | bd30c6fb336f7fc6d30fce9193d3005711f03b71 /newlib/libc/stdio | |
parent | d6f6f50285a4e6c05d1aad108da1d8da13cce004 (diff) | |
download | cygnal-14773e10a01ea162bb305975a4d439c52a620876.tar.gz cygnal-14773e10a01ea162bb305975a4d439c52a620876.tar.bz2 cygnal-14773e10a01ea162bb305975a4d439c52a620876.zip |
* libc/include/stdio.h (__SMOD): Remove definition of unused flag.
* libc/include/sys/reent.h (struct __sFILE): Add _flags2 member.
* libc/stdio/findfp.c (std): Initialize _flags2.
(__sfp): Ditto.
* libc/stdio/refill.c (__srefill_r): Drop resetting __SMOD flag.
* libc/stdio/vfscanf.c (__ssrefill_r): Ditto.
* libc/stdio/fseek.c (_fseek_r): Drop checking __SMOD flag.
* libc/stdio64/fseeko64.c (_fseeko64_r): Ditto.
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r-- | newlib/libc/stdio/findfp.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fseek.c | 6 | ||||
-rw-r--r-- | newlib/libc/stdio/refill.c | 1 | ||||
-rw-r--r-- | newlib/libc/stdio/vfscanf.c | 1 |
4 files changed, 4 insertions, 6 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index 4f613e537..0de2a7f23 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -46,6 +46,7 @@ _DEFUN(std, (ptr, flags, file, data), ptr->_r = 0; ptr->_w = 0; ptr->_flags = flags; + ptr->_flags2 = 0; ptr->_file = file; ptr->_bf._base = 0; ptr->_bf._size = 0; @@ -126,6 +127,7 @@ _DEFUN(__sfp, (d), found: fp->_file = -1; /* no file */ fp->_flags = 1; /* reserve this slot; caller sets real flags */ + fp->_flags2 = 0; #ifndef __SINGLE_THREAD__ __lock_init_recursive (fp->_lock); #endif diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c index 569bad742..06c66654e 100644 --- a/newlib/libc/stdio/fseek.c +++ b/newlib/libc/stdio/fseek.c @@ -304,12 +304,10 @@ _DEFUN(_fseek_r, (ptr, fp, offset, whence), /* * If the target offset is within the current buffer, * simply adjust the pointers, clear EOF, undo ungetc(), - * and return. (If the buffer was modified, we have to - * skip this; see fgetline.c.) + * and return. */ - if ((fp->_flags & __SMOD) == 0 && - target >= curoff && target < curoff + n) + if (target >= curoff && target < curoff + n) { register int o = target - curoff; diff --git a/newlib/libc/stdio/refill.c b/newlib/libc/stdio/refill.c index 6b329a852..9e76e668a 100644 --- a/newlib/libc/stdio/refill.c +++ b/newlib/libc/stdio/refill.c @@ -105,7 +105,6 @@ _DEFUN(__srefill_r, (ptr, fp), _CAST_VOID _fwalk (_GLOBAL_REENT, lflush); fp->_p = fp->_bf._base; fp->_r = fp->_read (ptr, fp->_cookie, (char *) fp->_p, fp->_bf._size); - fp->_flags &= ~__SMOD; /* buffer contents are again pristine */ #ifndef __CYGWIN__ if (fp->_r <= 0) #else diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index 39c5a0a99..0b5e9750b 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -379,7 +379,6 @@ _DEFUN(__ssrefill_r, (ptr, fp), /* Otherwise we are out of character input. */ fp->_p = fp->_bf._base; fp->_r = 0; - fp->_flags &= ~__SMOD; /* buffer contents are again pristine */ fp->_flags |= __SEOF; return EOF; } |