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

Don't call close() on -1. #502

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Conversation

CryptoManiac
Copy link
Contributor

Valgrind keeps complaining that close() on the invalid descriptor -1 is happening here. I suppose that close shouldn't be called when the descriptor value is known to be invalid. It's not a fatal error or something, but this practice is able to create a lot of flood in the logs.

Valgrind keeps complaining that close() on the invalid descriptor -1 is happening here. I suppose that close shouldn't be called when the descriptor value is known to be invalid. It's not a fatal error or something, but this practice is able to create a lot of flood in the logs.
@bsergean
Copy link
Collaborator

Thanks !
I usually put the -1 on the right hand side but that's fine.

@bsergean bsergean merged commit 98b4828 into machinezone:master Mar 19, 2024
7 checks passed
@CryptoManiac
Copy link
Contributor Author

Thanks ! I usually put the -1 on the right hand side but that's fine.

Putting constants on the left side of comparison is a compiler-agnostic way to prevent accidental assignment related bugs. Search for the term Yoda’s notation for more info.

@bsergean
Copy link
Collaborator

bsergean commented Mar 20, 2024 via email

@CryptoManiac
Copy link
Contributor Author

I had forgotten that Yoda denomination. Could you flip it the normal way? I like the code to stay consistent with the classical way.

Sure, I'll revise this tomorrow I think.

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.

2 participants