aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-05-21 18:17:29 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-05-21 18:17:29 +0000
commit789617d5ad3f4d7019e3086d515aa44f111dd0d8 (patch)
treecfbc1ccb4af025a3ee60046a411332c63cc6fdf3 /server.c
parentreaper: new module, uses a signalfd to wait() on child processes (diff)
term: don't double fork new terminal windows
Instead, register their PIDs with the new reaper module and let it handle them.
Diffstat (limited to 'server.c')
-rw-r--r--server.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/server.c b/server.c
index 75990ecd..ab627877 100644
--- a/server.c
+++ b/server.c
@@ -24,6 +24,7 @@ struct client;
struct server {
const struct config *conf;
struct fdm *fdm;
+ struct reaper *reaper;
struct wayland *wayl;
int fd;
@@ -311,7 +312,7 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
client->conf.startup_mode = STARTUP_FULLSCREEN;
client->term = term_init(
- &client->conf, server->fdm, server->wayl,
+ &client->conf, server->fdm, server->reaper, server->wayl,
"footclient", cwd, argc, argv, &term_shutdown_handler, client);
if (client->term == NULL) {
@@ -406,7 +407,8 @@ err:
}
struct server *
-server_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl)
+server_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper,
+ struct wayland *wayl)
{
int fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0);
if (fd == -1) {
@@ -448,6 +450,7 @@ server_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl)
*server = (struct server) {
.conf = conf,
.fdm = fdm,
+ .reaper = reaper,
.wayl = wayl,
.fd = fd,