aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 41054fcf..013b82eb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1147,12 +1147,6 @@ int main(int argc, char *argv[]) {
}
}
-#if defined(__OpenBSD__)
- if (pledge("stdio rpath wpath cpath proc exec unix", NULL) == -1) {
- err(EXIT_FAILURE, "pledge");
- }
-#endif
-
if (!disable_signalhandler) {
setup_signal_handler();
} else {
@@ -1220,6 +1214,17 @@ int main(int argc, char *argv[]) {
* when calling exit() */
atexit(i3_exit);
+ /* There might be children who died before we initialized the event loop,
+ * e.g., when restarting i3 (see #5756).
+ * To not carry zombie children around, raise the signal to invite libev to
+ * reap them.
+ *
+ * Note that there is no race condition between raising the signal below and
+ * entering the event loop later: the signal is just to notify libev that
+ * zombies might already be there. Actuall reaping will take place in the
+ * event loop anyway. */
+ (void)raise(SIGCHLD);
+
sd_notify(1, "READY=1");
ev_loop(main_loop, 0);