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

#2204 : use std handles if associated with streams #2980

Merged
merged 1 commit into from
May 14, 2024

Conversation

nomennescio
Copy link
Contributor

@nomennescio nomennescio requested a review from mrjbq7 May 14, 2024 15:13
@mrjbq7
Copy link
Member

mrjbq7 commented May 14, 2024

Does -2 have a constant name somewhere defined?

@mrjbq7
Copy link
Member

mrjbq7 commented May 14, 2024

Should we open nul only once using r+ and share the handle or is that not necessary? since they can be closed independently by factor?

@mrjbq7 mrjbq7 merged commit add5807 into factor:master May 14, 2024
3 checks passed
@nomennescio
Copy link
Contributor Author

Should we open nul only once using r+ and share the handle or is that not necessary? since they can be closed independently by factor?

I think it's indeed better to have 3 independent handles

@nomennescio
Copy link
Contributor Author

Does -2 have a constant name somewhere defined?

I can introduce a constant, but I didn't see anything mentioned in the documentation

@erg
Copy link
Member

erg commented May 15, 2024

There's no named constant for this. i asked chatgpt so it's true.

we could do this if we wanted though:

#define INVALID_HANDLE_FD -2
#define VALID_HANDLE(handle, mode) (_fileno(handle) == INVALID_HANDLE_FD ? fopen("nul", mode) : handle)

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

3 participants