about summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/fileops.c1
-rw-r--r--libio/oldfileops.c1
-rw-r--r--libio/wfileops.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/libio/fileops.c b/libio/fileops.c
index 8ced77b4c3..decb9d7185 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -358,6 +358,7 @@ _IO_new_file_underflow (fp)
 
   if (fp->_flags & _IO_NO_READS)
     {
+      fp->_flags |= _IO_ERR_SEEN;
       __set_errno (EBADF);
       return EOF;
     }
diff --git a/libio/oldfileops.c b/libio/oldfileops.c
index 02445215df..fd118a64e4 100644
--- a/libio/oldfileops.c
+++ b/libio/oldfileops.c
@@ -314,6 +314,7 @@ _IO_old_file_underflow (fp)
 
   if (fp->_flags & _IO_NO_READS)
     {
+      fp->_flags |= _IO_ERR_SEEN;
       __set_errno (EBADF);
       return EOF;
     }
diff --git a/libio/wfileops.c b/libio/wfileops.c
index f3f8bf25dd..3489b36fb1 100644
--- a/libio/wfileops.c
+++ b/libio/wfileops.c
@@ -120,6 +120,7 @@ _IO_wfile_underflow (fp)
 
   if (fp->_flags & _IO_NO_READS)
     {
+      fp->_flags |= _IO_ERR_SEEN;
       __set_errno (EBADF);
       return WEOF;
     }