diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-24 21:48:52 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-06-24 21:48:52 +0000 |
commit | a9ea7088e35a3479c83f0aaa6858ef0281b2a89f (patch) | |
tree | b88c7382ffe6905b124fd34e5e00627beda304ed /cpukit/libcsupport/src/read.c | |
parent | efd6e8e5a07fedca2e370f73b156b1a89b172cab (diff) |
2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com>
* libcsupport/src/read.c, libcsupport/src/write.c: read(2) and write(2)
should return 0 when passed a count of 0 after verifying other
possible errors.
Diffstat (limited to 'cpukit/libcsupport/src/read.c')
-rw-r--r-- | cpukit/libcsupport/src/read.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/read.c b/cpukit/libcsupport/src/read.c index 4e44eec4ff..34d07085b6 100644 --- a/cpukit/libcsupport/src/read.c +++ b/cpukit/libcsupport/src/read.c @@ -34,10 +34,12 @@ ssize_t read( rtems_libio_check_count( count ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ ); + if ( count == 0 ) + return 0; + /* * Now process the read(). */ - if ( !iop->handlers->read_h ) rtems_set_errno_and_return_minus_one( ENOTSUP ); |