diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-14 15:21:30 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-05-15 10:01:42 +0200 |
commit | 53da07e436df21f078de665d90442ee5c7166ab7 (patch) | |
tree | 0249d3ca4e181c677f243907a754dd1e8518bb36 /cpukit/libcsupport/src/write.c | |
parent | Filesystem: Add shared device IO support (diff) | |
download | rtems-53da07e436df21f078de665d90442ee5c7166ab7.tar.bz2 |
Filesystem: PR1255: Move offset update to handlers
It is now the responsibility of the read() and write() handler to update
the offset field of the IO descriptor (rtems_libio_t). This change
makes it possible to protect the IO descriptor from concurrent access by
per file locks.
Diffstat (limited to 'cpukit/libcsupport/src/write.c')
-rw-r--r-- | cpukit/libcsupport/src/write.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/cpukit/libcsupport/src/write.c b/cpukit/libcsupport/src/write.c index b74738845b..dc1255867d 100644 --- a/cpukit/libcsupport/src/write.c +++ b/cpukit/libcsupport/src/write.c @@ -29,7 +29,6 @@ ssize_t write( size_t count ) { - ssize_t rc; rtems_libio_t *iop; rtems_libio_check_fd( fd ); @@ -42,10 +41,5 @@ ssize_t write( /* * Now process the write() request. */ - rc = (*iop->pathinfo.handlers->write_h)( iop, buffer, count ); - - if ( rc > 0 ) - iop->offset += rc; - - return rc; + return (*iop->pathinfo.handlers->write_h)( iop, buffer, count ); } |