You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As specified in https://man7.org/linux/man-pages/man2/timerfd_create.2.html the file descriptor for a timerfd should be closed when it is no longer required. In nix::sys::timerfd::TimerFd there is no Drop implementation and the file descriptor is not automatically closed. This leads to a file descriptor leak.
The TimerFd struct either needs to properly own the file descriptor and close it when it's dropped, or make it explicit through documentation that the user of TimerFd needs to close the file descriptor themselves.
The text was updated successfully, but these errors were encountered:
1381: Close file descriptor on drop in TimerFd r=asomers a=crdumoul
This change closes the TimerFd file descriptor on drop. Note that the TimerFd will no longer be `Clone` or `Copy`. Since it has a destructor it can't be `Copy`, and if it were `Clone` you could end up trying to use a closed TimerFd, or double-closing the file descriptor.
Addresses #1379.
Co-authored-by: Christopher Dumoulin <[email protected]>
Co-authored-by: Alan Somers <[email protected]>
As specified in https://man7.org/linux/man-pages/man2/timerfd_create.2.html the file descriptor for a timerfd should be closed when it is no longer required. In
nix::sys::timerfd::TimerFd
there is noDrop
implementation and the file descriptor is not automatically closed. This leads to a file descriptor leak.The
TimerFd
struct either needs to properly own the file descriptor and close it when it's dropped, or make it explicit through documentation that the user ofTimerFd
needs to close the file descriptor themselves.The text was updated successfully, but these errors were encountered: