Loading
cherry-pick !8560
QDBusUnixFileDescriptor closes the file descriptor in its destructor, if we want to take ownership of it, we need to duplicate the file descriptor. If we don't duplicate it, but directly take "ownership" of the file descriptor, the following sequence of events can happen:
- ~QDBusUnixFileDescriptor closes file descriptor A
- some new fd B is allocated, which happens to have the same handle as fd A
- ~FileDescriptor closes fd A, but it has the same handle as fd, so it actually closes fd B!
- whenever fd B is used, we run into problems
To make such issues easier to debug in the future, this also adds debug logging for when closing a file descriptor fails.
BUG: 513151 (cherry picked from commit 30a7f528)