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/write.c | |
parent | 2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-a9ea7088e35a3479c83f0aaa6858ef0281b2a89f.tar.bz2 |
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/write.c')
-rw-r--r-- | cpukit/libcsupport/src/write.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/write.c b/cpukit/libcsupport/src/write.c index 3bda204015..0193466bd5 100644 --- a/cpukit/libcsupport/src/write.c +++ b/cpukit/libcsupport/src/write.c @@ -41,10 +41,12 @@ ssize_t write( rtems_libio_check_count( count ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); + if ( count == 0 ) + return 0; + /* * Now process the write() request. */ - if ( !iop->handlers->write_h ) rtems_set_errno_and_return_minus_one( ENOTSUP ); |