From 1be9a6ecb76e7a75b6365042a83cdd3ff74c1da4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Aug 2008 12:55:36 +0000 Subject: [PATCH] More verbose tracking of pppd git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3990 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- src/ppp-manager/nm-ppp-manager.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index 49de28cf3..7693117a0 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -585,7 +585,7 @@ nm_find_pppd (void) } static void -ppp_exit_code (guint pppd_exit_status) +ppp_exit_code (guint pppd_exit_status, GPid pid) { const char *msg; @@ -653,7 +653,7 @@ ppp_exit_code (guint pppd_exit_status) msg = "Unknown error"; } - g_warning ("pppd exited with error: %s", msg); + nm_warning ("ppp pid %d exited with error: %s", pid, msg); } static void @@ -666,15 +666,16 @@ ppp_watch_cb (GPid pid, gint status, gpointer user_data) if (WIFEXITED (status)) { err = WEXITSTATUS (status); if (err != 0) - ppp_exit_code (err); + ppp_exit_code (err, priv->pid); } else if (WIFSTOPPED (status)) - g_warning ("ppp stopped unexpectedly with signal %d", WSTOPSIG (status)); + nm_warning ("ppp pid %d stopped unexpectedly with signal %d", priv->pid, WSTOPSIG (status)); else if (WIFSIGNALED (status)) - g_warning ("ppp died with signal %d", WTERMSIG (status)); + nm_warning ("ppp pid %d died with signal %d", priv->pid, WTERMSIG (status)); else - g_warning ("ppp died from an unknown cause"); + nm_warning ("ppp pid %d died from an unknown cause", priv->pid); /* Reap child if needed. */ + nm_debug ("ppp pid %d cleaned up", priv->pid); waitpid (pid, NULL, WNOHANG); priv->pid = 0; @@ -949,6 +950,7 @@ ensure_killed (gpointer data) /* ensure the child is reaped */ waitpid (pid, NULL, WNOHANG); + nm_debug ("ppp pid %d cleaned up", pid); return FALSE; } @@ -991,6 +993,7 @@ nm_ppp_manager_stop (NMPPPManager *manager) kill (priv->pid, SIGKILL); /* ensure the child is reaped */ waitpid (priv->pid, NULL, WNOHANG); + nm_debug ("ppp pid %d cleaned up", priv->pid); } priv->pid = 0;