Changeset 3023


Ignore:
Timestamp:
Apr 7, 2007, 8:43:38 AM (18 years ago)
Author:
bird
Message:

Fixed fread bug that blocked up write-only streams. Fixes #146.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/src/libc/io/fread.c

    r2090 r3023  
    3333    {
    3434      errno = ERANGE;
     35      return 0;
     36    }
     37
     38  /* check that this stream can be read. */
     39  if ((stream->_flags & (_IOREAD | _IORW | _IOWRT)) == _IOWRT)
     40    {
     41      stream->_flags |= _IOERR;
     42      errno = EACCES;
    3543      return 0;
    3644    }
Note: See TracChangeset for help on using the changeset viewer.