This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use "|" instead of "+" when combine the _IO_LINE_BUF and _IO_UNBUFFERED flags
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Feng Gao <gfree dot wind at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 7 Jul 2015 21:58:58 +0530
- Subject: Re: [PATCH] Use "|" instead of "+" when combine the _IO_LINE_BUF and _IO_UNBUFFERED flags
- Authentication-results: sourceware.org; auth=none
- References: <CA+6hz4qE5L-6LQEvVawdKtXXrqpP-c-VO1SmGtamRJUoRWYLRQ at mail dot gmail dot com> <20150707073145 dot GK13549 at spoyarek dot pnq dot redhat dot com> <CA+6hz4r4FjfTN5+AfM=x7_2xCC-3_FMeniMHdYNufBRrd4g8Lg at mail dot gmail dot com>
On Wed, Jul 08, 2015 at 12:02:38AM +0800, Feng Gao wrote:
> About the tests, I did the following cases:
> 1. Write test codes to check if the (_IO_LINE_BUF|_IO_UNBUFFERED)
> equals (_IO_LINE_BUF+_IO_UNBUFFERED);
> 2. Update the glibc to check if it works like before.
Thanks, it looks like you missed fixing spacing in the last instance
(quoted below). Also, run 'make check' before and after the patch to
make sure that there are no regressions due to this change. Updating
glibc is a brave thing to do - if it breaks, your box is a brick that
only a rescue disk can get back :)
Please post an updated patch and also let me know the results of your
test.
Thanks,
Siddhesh
> @@ -477,7 +477,7 @@ _IO_wfile_overflow (_IO_FILE *f, wint_t wch)
> f->_IO_read_base = f->_IO_read_ptr = f->_IO_read_end;
>
> f->_flags |= _IO_CURRENTLY_PUTTING;
> - if (f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
> + if (f->_flags & (_IO_LINE_BUF|_IO_UNBUFFERED))
> f->_wide_data->_IO_write_end = f->_wide_data->_IO_write_ptr;
> }
> if (wch == WEOF)