[rtems commit] Filesystem: Clear open flag early in close()

Sebastian Huber sebh at rtems.org
Thu Oct 31 13:26:32 UTC 2013


Module:    rtems
Branch:    master
Commit:    61e3d1ad1e13abcdd0d10cafe098cbd6fccd6e10
Changeset: http://git.rtems.org/rtems/commit/?id=61e3d1ad1e13abcdd0d10cafe098cbd6fccd6e10

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Oct 25 11:51:10 2013 +0200

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.

---

 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 9b86d04..7aca365 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 );




More information about the vc mailing list