From 7c66269c9df88763b1c72d529541787dd7264664 Mon Sep 17 00:00:00 2001 From: Antony Mee Date: Sun, 7 Jan 2007 17:17:44 +0000 Subject: [PATCH] Patch from Helmut Schaa * Let nm-ppp-starter die gracefully even if pppd exits badly git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2214 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- vpn-daemons/pptp/src/nm-ppp-starter.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/vpn-daemons/pptp/src/nm-ppp-starter.c b/vpn-daemons/pptp/src/nm-ppp-starter.c index 5c15a8c7a1..0f3bb88834 100644 --- a/vpn-daemons/pptp/src/nm-ppp-starter.c +++ b/vpn-daemons/pptp/src/nm-ppp-starter.c @@ -771,6 +771,19 @@ static gint nm_ppp_get_cmdline_ppp (NmPPPData *data, char **data_items, const in return 0; } +/* + * nm_pptp_child_setup + * + * Set the process group ID of the newly forked process + * + */ +void nm_pptp_child_setup (gpointer user_data G_GNUC_UNUSED) +{ + /* We are in the child process at this point */ + pid_t pid = getpid (); + setpgid (pid, pid); +} + /* * nm_ppp_start_vpn_binary * @@ -836,7 +849,7 @@ static gint nm_ppp_start_ppp_binary (NmPPPData *data, char **data_items, const i } if (!g_spawn_async_with_pipes (NULL, (char **) ppp_argv->pdata, NULL, - G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &pid, &stdin_fd, + G_SPAWN_DO_NOT_REAP_CHILD, &nm_pptp_child_setup, NULL, &pid, &stdin_fd, NULL, NULL, &error)) { g_ptr_array_foreach(free_later,(GFunc)g_free,NULL);