Skip to content

Close file descriptor by default in 'vast::file' #1018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 10, 2020

Conversation

lava
Copy link
Member

@lava lava commented Aug 10, 2020

The change to "not close by default" was introduced in this commit, I'm not sure if it was intentional or just an oversight.

commit c01b22917f3b10fdea6d40ad3d9981dcf36693f3
Author: Matthias Vallentin <vallentin@icir.org>
Date:   Thu May 14 09:39:27 2015 -0700

    Fix bugs in filesystem interface
    
    Also, factor more POSIX wrappers.

Change the default behaviour of `vast::file` so that the associated
file descriptor is closed by default.

This is closer to the behaviour of standard library classes, and
less surprising to developers who expect a RAII by default.
@lava lava requested a review from dominiklohmann August 10, 2020 16:33
Remove the 'close_on_destruction_' member and the corresponding
constructor setting it from vast::file since there was no code
using this functionality.
Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. I have not tested this, but the change is very simple.

@dominiklohmann dominiklohmann added the bug Incorrect behavior label Aug 10, 2020
@lava lava merged commit 54b4791 into master Aug 10, 2020
@lava lava deleted the story/ch18804/vast-leaking-file-descriptors branch August 10, 2020 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants