diff options
| author | Leonardo Hernández Hernández <leohdz172@proton.me> | 2024-12-26 20:18:51 -0600 | 
|---|---|---|
| committer | Leonardo Hernández Hernández <leohdz172@proton.me> | 2025-01-14 12:23:55 -0600 | 
| commit | 26504f9a6f93e5b14819d5ed84dd27d3fbb41f3f (patch) | |
| tree | 6255713b3dbd12cbdedcc8332481c1b2544d8d45 /dwl.c | |
| parent | 6f34a6d3a6f6604af2c4c257343a31064983651f (diff) | |
do not call waitid(2) in the signal handler when Xwayland is enabled
waitid(2) is not a async-signal-safe function acording to signal-safety(7)
We can stop doing this because wlroots!4926 allows compositors to install
signal handlers for SIGCHLD.
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4926
Diffstat (limited to '')
| -rw-r--r-- | dwl.c | 16 | 
1 files changed, 2 insertions, 14 deletions
| @@ -1486,22 +1486,10 @@ gpureset(struct wl_listener *listener, void *data)  void  handlesig(int signo)  { -	if (signo == SIGCHLD) { -#ifdef XWAYLAND -		siginfo_t in; -		/* wlroots expects to reap the XWayland process itself, so we -		 * use WNOWAIT to keep the child waitable until we know it's not -		 * XWayland. -		 */ -		while (!waitid(P_ALL, 0, &in, WEXITED|WNOHANG|WNOWAIT) && in.si_pid -				&& (!xwayland || in.si_pid != xwayland->server->pid)) -			waitpid(in.si_pid, NULL, 0); -#else +	if (signo == SIGCHLD)  		while (waitpid(-1, NULL, WNOHANG) > 0); -#endif -	} else if (signo == SIGINT || signo == SIGTERM) { +	else if (signo == SIGINT || signo == SIGTERM)  		quit(NULL); -	}  }  void | 
