mirror of
https://github.com/swaywm/sway.git
synced 2026-04-18 06:46:56 -04:00
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:
parent
86ff19fade
commit
0e19d85d37
7 changed files with 23 additions and 28 deletions
|
|
@ -63,7 +63,6 @@ bool swaynag_spawn(const char *swaynag_command,
|
|||
sway_log(SWAY_ERROR, "Failed to create fork for swaynag");
|
||||
goto failed;
|
||||
} else if (pid == 0) {
|
||||
restore_nofile_limit();
|
||||
if (!sway_set_cloexec(sockets[1], false)) {
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
@ -148,4 +147,3 @@ void swaynag_show(struct swaynag_instance *swaynag) {
|
|||
close(swaynag->fd[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue