-
-
Notifications
You must be signed in to change notification settings - Fork 10
Fix the FD_CLOEXEC bit #10
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
Conversation
FD_CLOEXEC is not a bit position. It's a bit mask already. See the definition in the kernel: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/fcntl.h and the use of that constant in: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/fcntl.c The current code in sd-notify is a no-op. Bit 1 is not looked at by the kernel. sd-notify does not touch bit 0. Fix this by changing the mask.
Ouch, this is very embarrassing, thanks! Can you also add a changelog entry? |
Thanks for your review. I added a changelog entry. |
Meh, the changelog should have said |
One more question: Thanks a lot for your time. :) |
Yes, I wanted to include #8, but I'll probably have to ping the author. |
Cool. Thanks. Take your time. |
In the meanwhile, another pair of eyes on that PR would be appreciated, just saying 😅. |
Hi Is it possible to make a release with just this fix applied? Thanks a lot 👍 |
Right, sorry. I'll try to do it tomorrow. |
Done, and sorry for the delays: https://crates.io/crates/sd-notify |
Thank you very much for your work. This really is an important and useful crate, IMO. |
Thanks, btw! |
FD_CLOEXEC is not a bit position. It's a bit mask already.
See the definition in the kernel:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/fcntl.h
and the use of that constant in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/fcntl.c
The current code in sd-notify is a no-op. Bit 1 is not looked at by the kernel. sd-notify does not touch bit 0.
Fix this by changing the mask.