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

Fix leaking of FDs created by pipe #87

Merged
merged 1 commit into from
May 8, 2018
Merged

Conversation

Vogtinator
Copy link
Contributor

Use pipe2 to pass O_CLOEXEC.

Use pipe2 to pass O_CLOEXEC.
@hanna-kn
Copy link
Contributor

hanna-kn commented May 8, 2018

If I'm not mistaken, pipe2 is not very portable. There is a different implementation of the Thread class in libqalculate for win32, but the code must work for MacOS and other non-Linux systems.

@Vogtinator
Copy link
Contributor Author

Any other implementation, like using fcntl, would be inherently racy.

So I guess using autotools feature detection is the best way here. I'm not very familiar with autotools though.

@hanna-kn
Copy link
Contributor

hanna-kn commented May 8, 2018

I just need to add AC_CHECK_FUNCS([pipe2]) to configure.ac and use #ifdef HAVE_PIPE2.

I will merge your changes and then add the checks.

@hanna-kn hanna-kn merged commit e5b42e0 into Qalculate:master May 8, 2018
@Vogtinator
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants