-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Proposed fix for swayidle forking behaviour #3382
Conversation
swayidle/main.c
Outdated
} else { | ||
// sd_bus_message_unref closes the file descriptor so we need |
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.
Style: can we replace this with goto-based error handling?
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.
Since we waitpid
we won't leave zombies behind. I think the default config has some swayidle
example that needs to be updated. Do we want -f
to be the default?
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.
In any case, we should remove the 1 second timer.
I don't think forking should be the default, but if you want it to be, please suggest what the flag and description should be. |
I think |
Makes sense. I've changed it to |
This looks good. I think the example config still needs to be updated, to use |
We also need to make sure this correctly locks the screen before idling. |
} | ||
|
||
// sd_bus_message_unref closes the file descriptor so we need | ||
// to copy it beforehand | ||
lock_fd = fcntl(lock_fd, F_DUPFD_CLOEXEC, 3); | ||
if (lock_fd < 0) { | ||
wlr_log(WLR_ERROR, "Failed to copy sleep lock fd: %s", | ||
strerror(errno)); | ||
wlr_log(WLR_ERROR, "Failed to copy sleep lock fd: %s", strerror(errno)); |
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.
Missing goto
here
@@ -16,6 +16,10 @@ swayidle - Idle manager for Wayland | |||
*-d* | |||
Enable debug output. | |||
|
|||
*-w* | |||
Wait for command to finish executing before continuing, helpful for ensuring | |||
that a *before-sleep* command has finished before the system goes to sleep. |
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.
Maybe add a warning like "swayidle will block until the command finishes".
This needs to be moved to the new repo |
This should fix #3119, but I'm not sure whether it has the potential to leave zombie processes.