From df6c012b99499d95ed7fee53553a9f4d4473ccae Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 7 Feb 2018 19:41:01 -0500 Subject: Remove _IO_file_flags define. This entirely mechanical (except for some indentation fixups) patch replaces all uses of _IO_file_flags with _flags and removes the #define. Installed stripped libraries and executables are unchanged by this patch. * libio/libio.h (_IO_file_flags): Remove macro. All uses changed to _flags. --- debug/fgets_chk.c | 9 ++++----- debug/fgets_u_chk.c | 9 ++++----- debug/fgetws_chk.c | 6 +++--- debug/fgetws_u_chk.c | 9 ++++----- debug/gets_chk.c | 8 ++++---- 5 files changed, 19 insertions(+), 22 deletions(-) (limited to 'debug') diff --git a/debug/fgets_chk.c b/debug/fgets_chk.c index f223653370..f3548c7d61 100644 --- a/debug/fgets_chk.c +++ b/debug/fgets_chk.c @@ -40,13 +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) - && errno != EAGAIN)) + if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN)) result = NULL; else if (count >= size) __chk_fail (); @@ -55,7 +54,7 @@ __fgets_chk (char *buf, size_t size, int n, FILE *fp) buf[count] = '\0'; result = buf; } - fp->_IO_file_flags |= old_error; + fp->_flags |= old_error; _IO_release_lock (fp); return result; } diff --git a/debug/fgets_u_chk.c b/debug/fgets_u_chk.c index 317ae5649d..924634c17b 100644 --- a/debug/fgets_u_chk.c +++ b/debug/fgets_u_chk.c @@ -39,13 +39,12 @@ __fgets_unlocked_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) - && errno != EAGAIN)) + if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN)) result = NULL; else if (count >= size) __chk_fail (); @@ -54,6 +53,6 @@ __fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp) buf[count] = '\0'; result = buf; } - fp->_IO_file_flags |= old_error; + fp->_flags |= old_error; return result; } diff --git a/debug/fgetws_chk.c b/debug/fgetws_chk.c index 8ea6635b30..2380059f0f 100644 --- a/debug/fgetws_chk.c +++ b/debug/fgetws_chk.c @@ -32,8 +32,8 @@ __fgetws_chk (wchar_t *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. */ - old_error = fp->_IO_file_flags & _IO_ERR_SEEN; - fp->_IO_file_flags &= ~_IO_ERR_SEEN; + old_error = fp->_flags & _IO_ERR_SEEN; + fp->_flags &= ~_IO_ERR_SEEN; count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\n', 1); /* If we read in some bytes and errno is EAGAIN, that error will be reported for next read. */ @@ -46,7 +46,7 @@ __fgetws_chk (wchar_t *buf, size_t size, int n, FILE *fp) buf[count] = '\0'; result = buf; } - fp->_IO_file_flags |= old_error; + fp->_flags |= old_error; _IO_release_lock (fp); return result; } diff --git a/debug/fgetws_u_chk.c b/debug/fgetws_u_chk.c index 42dad6bc8b..8147eb1e36 100644 --- a/debug/fgetws_u_chk.c +++ b/debug/fgetws_u_chk.c @@ -40,13 +40,12 @@ __fgetws_unlocked_chk (wchar_t *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. */ - old_error = fp->_IO_file_flags & _IO_ERR_SEEN; - fp->_IO_file_flags &= ~_IO_ERR_SEEN; + old_error = fp->_flags & _IO_ERR_SEEN; + fp->_flags &= ~_IO_ERR_SEEN; count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\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) - && errno != EAGAIN)) + if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN)) result = NULL; else if (count >= size) __chk_fail (); @@ -55,6 +54,6 @@ __fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, FILE *fp) buf[count] = '\0'; result = buf; } - fp->_IO_file_flags |= old_error; + fp->_flags |= old_error; return result; } diff --git a/debug/gets_chk.c b/debug/gets_chk.c index df3f947e70..2b1416b295 100644 --- a/debug/gets_chk.c +++ b/debug/gets_chk.c @@ -51,17 +51,17 @@ __gets_chk (char *buf, size_t size) /* 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 = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN; - _IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN; + int old_error = _IO_stdin->_flags & _IO_ERR_SEEN; + _IO_stdin->_flags &= ~_IO_ERR_SEEN; buf[0] = (char) ch; count = _IO_getline (_IO_stdin, buf + 1, size - 1, '\n', 0) + 1; - if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN) + if (_IO_stdin->_flags & _IO_ERR_SEEN) { retval = NULL; goto unlock_return; } else - _IO_stdin->_IO_file_flags |= old_error; + _IO_stdin->_flags |= old_error; } if (count >= size) __chk_fail (); -- cgit 1.4.1