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/ftruncate.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 'cpukit/libcsupport/src/ftruncate.c')
-rw-r--r-- | cpukit/libcsupport/src/ftruncate.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/ftruncate.c b/cpukit/libcsupport/src/ftruncate.c index 401510b2ff..99a9c6b5ef 100644 --- a/cpukit/libcsupport/src/ftruncate.c +++ b/cpukit/libcsupport/src/ftruncate.c @@ -32,6 +32,7 @@ int ftruncate( int fd, off_t length ) LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EINVAL ); rv = (*iop->pathinfo.handlers->ftruncate_h)( iop, length ); + rtems_libio_iop_drop( iop ); } else { errno = EINVAL; rv = -1; |