summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/libio.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-03-10 17:07:19 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-03-13 09:57:04 +0100
commitc2287ba2cff59a50848151833404bce0e3cf0a70 (patch)
tree24fbd290baf4722b2dd56df731f44b41b6765c45 /cpukit/include/rtems/libio.h
parentmrm332-testsuite.tcfg: Add dl01 (diff)
downloadrtems-c2287ba2cff59a50848151833404bce0e3cf0a70.tar.bz2
libio: Robust file descriptor reference counting
There was a race conditon in the reference counting of file descriptors during a close() operation. After the call to the close handler, the rtems_libio_free() function cleared the flags to zero. However, at this point in time there may still exist some holders of the file descriptor. With RTEMS_DEBUG enabled this could lead to failed assertions in rtems_libio_iop_drop(). Change the code to use only atomic read-modify-write operations on the rtems_libio_iop::flags.
Diffstat (limited to 'cpukit/include/rtems/libio.h')
-rw-r--r--cpukit/include/rtems/libio.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/include/rtems/libio.h b/cpukit/include/rtems/libio.h
index b5362320e8..bbaae10efd 100644
--- a/cpukit/include/rtems/libio.h
+++ b/cpukit/include/rtems/libio.h
@@ -1318,8 +1318,8 @@ extern const rtems_filesystem_limits_and_options_t
* to (eg: offset, driver, pathname should be in that)
*/
struct rtems_libio_tt {
- off_t offset; /* current offset into file */
Atomic_Uint flags;
+ off_t offset; /* current offset into file */
rtems_filesystem_location_info_t pathinfo;
uint32_t data0; /* private to "driver" */
void *data1; /* ... */