From baef823cd550449bfbcc36625b9571389d8ad1af Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 13 Sep 2017 09:22:19 +0200 Subject: 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. --- cpukit/libcsupport/src/ftruncate.c | 1 + 1 file changed, 1 insertion(+) (limited to 'cpukit/libcsupport/src/ftruncate.c') 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; -- cgit v1.2.3