Changeset 9dae51d7 in mainline


Ignore:
Timestamp:
2006-09-06T21:54:12Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9141377
Parents:
d7e3f1ad
Message:

read() and write() now check if the virtual function they want to
call exists. Thus, these calls will not kill the whole task
if called for instance from a driver task but gracefully fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/libc/generic/io/stream.c

    rd7e3f1ad r9dae51d7  
    165165ssize_t write(int fd, const void *buf, size_t count)
    166166{
    167 //      __SYSCALL3(SYS_IO, 1, (sysarg_t)buf, (sysarg_t) count);
    168 //      return count;
    169         if (fd < FDS)
     167        if (fd < FDS && streams[fd].w)
    170168                return streams[fd].w(streams[fd].param, buf, count);
    171169       
     
    175173ssize_t read(int fd, void *buf, size_t count)
    176174{
    177         if (fd < FDS)
     175        if (fd < FDS && streams[fd].r)
    178176                return streams[fd].r(streams[fd].param, buf, count);
    179177       
Note: See TracChangeset for help on using the changeset viewer.