summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-25 11:51:10 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-31 14:30:41 +0100
commit61e3d1ad1e13abcdd0d10cafe098cbd6fccd6e10 (patch)
treeb857b400b8d15c9ca89313238177cbfeb794243a
parentFilesystem: Zero flags in rtems_libio_free() (diff)
downloadrtems-61e3d1ad1e13abcdd0d10cafe098cbd6fccd6e10.tar.bz2
Filesystem: Clear open flag early in close()
This helps to prevent the usage of a file descriptor which is about to close in some situations.
-rw-r--r--cpukit/libcsupport/src/close.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/close.c b/cpukit/libcsupport/src/close.c
index 9b86d04d05..7aca365f8c 100644
--- a/cpukit/libcsupport/src/close.c
+++ b/cpukit/libcsupport/src/close.c
@@ -31,6 +31,8 @@ int close(
iop = rtems_libio_iop(fd);
rtems_libio_check_is_open(iop);
+ iop->flags &= ~LIBIO_FLAGS_OPEN;
+
rc = (*iop->pathinfo.handlers->close_h)( iop );
rtems_libio_free( iop );