This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/6] Remove _IO_file_flags define.
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: libc-alpha at sourceware dot org, fweimer at redhat dot com, adhemerval dot zanella at linaro dot org
- Date: Sun, 11 Feb 2018 18:57:14 +0100
- Subject: Re: [PATCH 4/6] Remove _IO_file_flags define.
- Authentication-results: sourceware.org; auth=none
- References: <20180211163558.14124-1-zackw@panix.com> <20180211163558.14124-5-zackw@panix.com>
On Feb 11 2018, Zack Weinberg <zackw@panix.com> wrote:
> * libio/libio.h (_IO_file_flags): Remove macro.
> All uses changed to _flags.
Ok.
> diff --git a/debug/fgets_chk.c b/debug/fgets_chk.c
> index f2236533700..d86454f3e81 100644
> --- a/debug/fgets_chk.c
> +++ b/debug/fgets_chk.c
> @@ -40,12 +40,12 @@ __fgets_chk (char *buf, size_t size, int n, FILE *fp)
> /* This is very tricky since a file descriptor may be in the
> non-blocking mode. The error flag doesn't mean much in this
> case. We return an error only when there is a new error. */
> - int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
> - fp->_IO_file_flags &= ~_IO_ERR_SEEN;
> + int old_error = fp->_flags & _IO_ERR_SEEN;
> + fp->_flags &= ~_IO_ERR_SEEN;
> count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
> /* If we read in some bytes and errno is EAGAIN, that error will
> be reported for next read. */
> - if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
> + if (count == 0 || ((fp->_flags & _IO_ERR_SEEN)
> && errno != EAGAIN))
Could be unfolded.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."