Chris Johns commented on a discussion on cpukit/libcsupport/src/libio.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/516#note_125239 > - * Clear everything except the reference count part. At this point in > time > - * there may be still some holders of this file descriptor. > - */ > - rtems_libio_iop_flags_clear( iop, LIBIO_FLAGS_REFERENCE_INC - 1U ); > - zero = offsetof( rtems_libio_t, offset ); > - memset( (char *) iop + zero, 0, sizeof( *iop ) - zero ); > + rtems_libio_lock(); > > - /* > - * Append it to the free list. This increases the likelihood that a use > - * after close is detected. > - */ > - *rtems_libio_iop_free_tail = iop; > - rtems_libio_iop_free_tail = &iop->data1; > + zero = offsetof( rtems_libio_t, offset ); > + memset( (char *) iop + zero, 0, sizeof( *iop ) - zero ); Explain which bit? I have only moved the existing code and updated the flags related comment. -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/516#note_125239 You're receiving this email because of your account on gitlab.rtems.org.
_______________________________________________ bugs mailing list bugs@rtems.org http://lists.rtems.org/mailman/listinfo/bugs