-
Notifications
You must be signed in to change notification settings - Fork 477
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
afprog: manual cloexec #3416
afprog: manual cloexec #3416
Conversation
Build SUCCESS |
ea26525
to
81bbf6f
Compare
Do we still need the We might be able to remove the |
Build SUCCESS |
Both java and python languages bindings uses threads and not forking. In spite of those modules there is still fork used in syslog-ng.
Not to mention that we could have a lib that does |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works perfectly, thanks! 👍
@@ -145,13 +184,20 @@ afprogram_popen(AFProgramProcessInfo *process_info, GIOCondition cond, gint *fd) | |||
close(msg_pipe[0]); | |||
close(msg_pipe[1]); | |||
|
|||
_close_all_fd(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the latest iteration, nothing ensures that sync-fd is closed after all inherited sockets, so you would need to to dup2() it to fd 3 to make sure. If we inherited fd 3, that would simply close it before the iteration, but then syncfd is closed last.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides Bazsi's comment to use fd 3 approve from my side.
cf7a52a
to
ff526e8
Compare
Build SUCCESS |
Signed-off-by: Kokan <[email protected]>
Signed-off-by: Kokan <[email protected]>
ff526e8
to
38a8080
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Build SUCCESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Parent waits for child to close all fd before
exec
.Fixes #3409.