diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-13 09:22:19 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-15 10:29:34 +0200 |
commit | baef823cd550449bfbcc36625b9571389d8ad1af (patch) | |
tree | 238c1952d23dc09d41ae99d186d0656f78ed857b /cpukit/libcsupport/src/write.c | |
parent | libio: Unify readv() and writev() (diff) | |
download | rtems-baef823cd550449bfbcc36625b9571389d8ad1af.tar.bz2 |
libio: Add hold/drop iop reference
Check iop reference count in close() and return -1 with errno set to
EBUSY in case the file descriptor is still in use.
Update #3132.
Diffstat (limited to '')
-rw-r--r-- | cpukit/libcsupport/src/write.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/libcsupport/src/write.c b/cpukit/libcsupport/src/write.c index f44962afd8..a90b291ed8 100644 --- a/cpukit/libcsupport/src/write.c +++ b/cpukit/libcsupport/src/write.c @@ -34,6 +34,7 @@ ssize_t write( ) { rtems_libio_t *iop; + ssize_t n; rtems_libio_check_buffer( buffer ); rtems_libio_check_count( count ); @@ -43,5 +44,7 @@ ssize_t write( /* * Now process the write() request. */ - return (*iop->pathinfo.handlers->write_h)( iop, buffer, count ); + n = (*iop->pathinfo.handlers->write_h)( iop, buffer, count ); + rtems_libio_iop_drop( iop ); + return n; } |