[vte/vte-0-60] pty: spawn: Reap the child process if the systemd call fails



commit 7f9e9584e88b7935dfa58044def4f878752d8123
Author: Christian Persch <chpe src gnome org>
Date:   Thu Apr 9 21:10:19 2020 +0200

    pty: spawn: Reap the child process if the systemd call fails

 src/pty.cc | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/pty.cc b/src/pty.cc
index b0f56af8..4f2bcce5 100644
--- a/src/pty.cc
+++ b/src/pty.cc
@@ -34,6 +34,7 @@
 #include "vteptyinternal.hh"
 #include "vtetypes.hh"
 #include "vtespawn.hh"
+#include "reaper.hh"
 
 #include <assert.h>
 #include <sys/types.h>
@@ -488,6 +489,8 @@ Pty::spawn(char const* directory,
                                                      cancellable,
                                                      err)) {
                 if (spawn_flags & VTE_SPAWN_REQUIRE_SYSTEMD_SCOPE) {
+                       vte_reaper_add_child(pid);
+
                         auto pgrp = getpgid(pid);
                         if (pgrp != -1) {
                                 kill(-pgrp, SIGHUP);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]