diff options
author | Feng Gao <gfree.wind@gmail.com> | 2015-07-08 13:40:50 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2015-07-08 13:53:11 +0530 |
commit | 2e4250225cf894e11c926007698cea8096a372fb (patch) | |
tree | b9e544e969ae95d13f3ee6ea7c3f6a77427e2e9d /libio/fileops.c | |
parent | 808696696837b8b8fc858f2e6f8d4e40e26e1308 (diff) | |
download | glibc-2e4250225cf894e11c926007698cea8096a372fb.tar glibc-2e4250225cf894e11c926007698cea8096a372fb.tar.gz glibc-2e4250225cf894e11c926007698cea8096a372fb.tar.bz2 glibc-2e4250225cf894e11c926007698cea8096a372fb.zip |
Use "|" instead of "+" when combine the _IO_LINE_BUF and _IO_UNBUFFERED flags
Both of "_IO_UNBUFFERED" and "_IO_LINE_BUF" are the bit flags, but I
find there are some codes looks like "_IO_LINE_BUF+_IO_UNBUFFERED",
while some codes are "_IO_LINE_BUF|_IO_UNBUFFERED".
I think the former is not good, even though the final result is same.
Diffstat (limited to 'libio/fileops.c')
-rw-r--r-- | libio/fileops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libio/fileops.c b/libio/fileops.c index 966802443c..cbcd6f5353 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -521,7 +521,7 @@ new_do_write (_IO_FILE *fp, const char *data, _IO_size_t to_do) _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base); fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base; fp->_IO_write_end = (fp->_mode <= 0 - && (fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED)) + && (fp->_flags & (_IO_LINE_BUF | _IO_UNBUFFERED)) ? fp->_IO_buf_base : fp->_IO_buf_end); return count; } @@ -844,7 +844,7 @@ _IO_new_file_overflow (_IO_FILE *f, int ch) f->_IO_read_base = f->_IO_read_ptr = f->_IO_read_end; f->_flags |= _IO_CURRENTLY_PUTTING; - if (f->_mode <= 0 && f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED)) + if (f->_mode <= 0 && f->_flags & (_IO_LINE_BUF | _IO_UNBUFFERED)) f->_IO_write_end = f->_IO_write_ptr; } if (ch == EOF) |