diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-12-25 10:39:27 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-12-25 10:39:27 +0000 |
commit | 105320fa7b3665877cb3c50c821d10cf7ce154d0 (patch) | |
tree | 1b9b6f46b453cf110c6df3493e977b4468af25f6 /libc/libio/fileops.c | |
parent | 94c459cc7a611211d10773eef526826a8da80456 (diff) | |
download | eglibc2-105320fa7b3665877cb3c50c821d10cf7ce154d0.tar.gz |
Merge changes between r21911 and r22029 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@22061 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/libio/fileops.c')
-rw-r--r-- | libc/libio/fileops.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/libc/libio/fileops.c b/libc/libio/fileops.c index dd8b4c170..7faefed35 100644 --- a/libc/libio/fileops.c +++ b/libc/libio/fileops.c @@ -156,21 +156,13 @@ int _IO_new_file_close_it (fp) _IO_FILE *fp; { + int write_status; if (!_IO_file_is_open (fp)) return EOF; - int write_status; - if (_IO_in_put_mode (fp)) + if ((fp->_flags & _IO_NO_WRITES) == 0 + && (fp->_flags & _IO_CURRENTLY_PUTTING) != 0) write_status = _IO_do_flush (fp); - else if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL - && !_IO_in_backup (fp)) - { - off64_t o = _IO_SEEKOFF (fp, 0, _IO_seek_cur, 0); - if (o == WEOF) - write_status = EOF; - else - write_status = _IO_SYSSEEK (fp, o, SEEK_SET) < 0 ? EOF : 0; - } else write_status = 0; |