diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-10-25 11:51:10 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-10-31 14:30:41 +0100 |
commit | 61e3d1ad1e13abcdd0d10cafe098cbd6fccd6e10 (patch) | |
tree | b857b400b8d15c9ca89313238177cbfeb794243a | |
parent | Filesystem: Zero flags in rtems_libio_free() (diff) | |
download | rtems-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.c | 2 |
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 ); |