Skip to content
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

Close logpipe input file descriptor after dup2() #116

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Commits on Oct 16, 2023

  1. Close logpipe input file descriptor after dup2()

    When the input file descriptor of the `pipe()` is `dup2()`'d into
    `stdin` and `stdout` it is effectively copied, leaving the original file
    descriptor open and leaking at the end of these statements.  Only the
    output file descriptor has its ownership transferred to `File` and will
    be cleaned up properly.
    
    This should cause the reading end to read EOF and return zero bytes when
    `stdin` and `stdout` is open, rather than remaining open "indefinitely"
    (barring the whole process being taken down) as there will always be
    that one file descriptor referencing the input end of the pipe.
    MarijnS95 committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    707a9d3 View commit details
    Browse the repository at this point in the history