This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/6] Remove _IO_file_flags define.


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]