diff options
Diffstat (limited to 'libio')
-rw-r--r-- | libio/libioP.h | 19 | ||||
-rw-r--r-- | libio/oldfileops.c | 10 |
2 files changed, 22 insertions, 7 deletions
diff --git a/libio/libioP.h b/libio/libioP.h index 4891294726..004c95ab8d 100644 --- a/libio/libioP.h +++ b/libio/libioP.h @@ -552,15 +552,28 @@ extern int _IO_vscanf __P ((const char *, _IO_va_list)); #ifdef _IO_MTSAFE_IO /* check following! */ -# define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \ +# ifdef _IO_USE_OLD_IO_FILE +# define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \ 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock } +# else +# define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \ + { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \ + 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock, _IO_pos_BAD } +# endif #else -/* check following! */ -# define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \ +# ifdef _IO_USE_OLD_IO_FILE +# define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, 0, _IO_pos_BAD } +# else +# define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \ + { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \ + 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock, _IO_pos_BAD } +# endif #endif /* VTABLE_LABEL defines NAME as of the CLASS class. diff --git a/libio/oldfileops.c b/libio/oldfileops.c index 251dc78c6c..ae710b1539 100644 --- a/libio/oldfileops.c +++ b/libio/oldfileops.c @@ -583,10 +583,12 @@ _IO_old_file_seekoff (fp, offset, dir, mode) _IO_unsave_markers (fp); result = _IO_SYSSEEK (fp, offset, dir); if (result != EOF) - _IO_mask_flags (fp, 0, _IO_EOF_SEEN); - fp->_old_offset = result; - _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base); - _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base); + { + _IO_mask_flags (fp, 0, _IO_EOF_SEEN); + fp->_old_offset = result; + _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base); + _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base); + } return result; } |