aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-07-23 04:57:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-07-23 05:17:21 +0000
commita42f99081876dd02e28b931f7c0e70230355bb58 (patch)
treec49e60ec7ce07cead0767afd8d2bd896679a32af /terminal.c
parentosc: kitty notifications: use body as title, if no title is set (diff)
spawn: add optional reaper callback, return pid_t
This will allow spawn() callers to do things when the spawned process has terminated.
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/terminal.c b/terminal.c
index 712b9d4e..bf0c78dc 100644
--- a/terminal.c
+++ b/terminal.c
@@ -198,7 +198,7 @@ add_utmp_record(const struct config *conf, struct reaper *reaper, int ptmx)
return true;
char *const argv[] = {conf->utmp_helper_path, UTMP_ADD, getenv("WAYLAND_DISPLAY"), NULL};
- return spawn(reaper, NULL, argv, ptmx, ptmx, -1, NULL);
+ return spawn(reaper, NULL, argv, ptmx, ptmx, -1, NULL, NULL, NULL) >= 0;
#else
return true;
#endif
@@ -222,7 +222,7 @@ del_utmp_record(const struct config *conf, struct reaper *reaper, int ptmx)
;
char *const argv[] = {conf->utmp_helper_path, UTMP_DEL, del_argument, NULL};
- return spawn(reaper, NULL, argv, ptmx, ptmx, -1, NULL);
+ return spawn(reaper, NULL, argv, ptmx, ptmx, -1, NULL, NULL, NULL) >= 0;
#else
return true;
#endif
@@ -3594,7 +3594,7 @@ term_bell(struct terminal *term)
{
int devnull = open("/dev/null", O_RDONLY);
spawn(term->reaper, NULL, term->conf->bell.command.argv.args,
- devnull, -1, -1, NULL);
+ devnull, -1, -1, NULL, NULL, NULL);
if (devnull >= 0)
close(devnull);
@@ -3606,7 +3606,7 @@ term_spawn_new(const struct terminal *term)
{
return spawn(
term->reaper, term->cwd, (char *const []){term->foot_exe, NULL},
- -1, -1, -1, NULL);
+ -1, -1, -1, NULL, NULL, NULL) >= 0;
}
void