Tookmund / Swapspace

A fork of Jeroen T. Vermeulen's excellent dynamic swap space manager
GNU General Public License v2.0
139 stars 13 forks source link

close file descriptors to avoid holding unlinked files open #7

Closed briangough closed 8 years ago

briangough commented 8 years ago

Avoid leaking file descriptors, in order to free disk space after unlinking files.

Currently the disk space for retired swap files is not freed after they are unlinked if the filesize() function has been called, due to a leaked file descriptor holding the file open.

There is also a leaked file descriptor in retire_swapfile() when in paranoid mode.

Tookmund commented 8 years ago

LGTM. Thanks for fixing this!