Use pthread_atfork() to restore signals and NOFILE limit

This ensures these functions are always called (even when a library
such as wlroots or libc perform the fork) and removes the need to
manually call them.
This commit is contained in:
Simon Ser 2025-04-20 21:09:57 +02:00 committed by myrslint
parent 2bc286ae30
commit 692208118f
7 changed files with 23 additions and 28 deletions

View file

@ -228,8 +228,6 @@ static void invoke_swaybar(struct bar_config *bar) {
sway_log(SWAY_ERROR, "Failed to create fork for swaybar");
return;
} else if (pid == 0) {
restore_nofile_limit();
restore_signals();
if (!sway_set_cloexec(sockets[1], false)) {
_exit(EXIT_FAILURE);
}