Feldman's stdio changes
[unix-history] / usr / src / lib / libc / stdio / rewind.c
index 63356b0..bb66005 100644 (file)
@@ -1,4 +1,4 @@
-/* @(#)rewind.c        4.1 (Berkeley) %G% */
+/* @(#)rewind.c        4.2 (Berkeley) %G% */
 #include       <stdio.h>
 
 rewind(iop)
 #include       <stdio.h>
 
 rewind(iop)
@@ -9,4 +9,6 @@ register struct _iobuf *iop;
        iop->_cnt = 0;
        iop->_ptr = iop->_base;
        iop->_flag &= ~(_IOERR|_IOEOF);
        iop->_cnt = 0;
        iop->_ptr = iop->_base;
        iop->_flag &= ~(_IOERR|_IOEOF);
+       if (iop->_flag & _IORW)
+               iop->_flag &= ~(_IOREAD|_IOWRT);
 }
 }