[network-manager-libreswan] service: correct tracing of processes that block quit



commit b52f353462ad95797609a7456feb65ad958229d9
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Mar 18 15:42:45 2016 +0100

    service: correct tracing of processes that block quit
    
    Always decrement is when the process exits; even if we've run another
    one since.
    
    Also, add some logging.

 src/nm-libreswan-service.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/nm-libreswan-service.c b/src/nm-libreswan-service.c
index 5e07cf3..ffaf192 100644
--- a/src/nm-libreswan-service.c
+++ b/src/nm-libreswan-service.c
@@ -528,6 +528,9 @@ child_watch_cb (GPid pid, gint status, gpointer user_data)
        GError *error = NULL;
        gboolean success;
 
+       DEBUG ("Spawn: child %d exited", pid);
+       unblock_quit (self);
+
        if (priv->watch_id == 0 || priv->pid != pid) {
                /* Reap old child */
                waitpid (pid, NULL, WNOHANG);
@@ -537,9 +540,6 @@ child_watch_cb (GPid pid, gint status, gpointer user_data)
        priv->watch_id = 0;
        priv->pid = 0;
 
-       DEBUG ("Spawn: child %d exited", pid);
-       unblock_quit (self);
-
        if (WIFEXITED (status)) {
                ret = WEXITSTATUS (status);
                if (ret)
@@ -829,6 +829,8 @@ spawn_pty (NMLibreswanPlugin *self,
                _exit (-1);
        }
 
+       DEBUG ("PTY spawn: child process %d", child_pid);
+
        /* Close child side's pipes */
        close (stderr_pipe[1]);
        close (stdout_pipe[1]);


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