diff options
Diffstat (limited to 'src/dhcp-manager/nm-dhcp-client.c')
-rw-r--r-- | src/dhcp-manager/nm-dhcp-client.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 4c19b300a..3418bf3b2 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -136,10 +136,10 @@ watch_cleanup (NMDHCPClient *self) } } -static void -stop_process (GPid pid, const char *iface) +void +nm_dhcp_client_stop_pid (GPid pid, const char *iface, guint timeout_secs) { - int i = 15; /* 3 seconds */ + int i = (timeout_secs ? timeout_secs : 3) * 5; /* default 3 seconds */ g_return_if_fail (pid > 0); @@ -183,7 +183,7 @@ stop_process (GPid pid, const char *iface) } static void -real_stop (NMDHCPClient *self) +real_stop (NMDHCPClient *self, gboolean release) { NMDHCPClientPrivate *priv; @@ -196,7 +196,7 @@ real_stop (NMDHCPClient *self) /* Clean up the watch handler since we're explicitly killing the daemon */ watch_cleanup (self); - stop_process (priv->pid, priv->iface); + nm_dhcp_client_stop_pid (priv->pid, priv->iface, 0); priv->info_only = FALSE; } @@ -376,7 +376,7 @@ nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name) exe = proc_contents; if (!strcmp (exe, binary_name)) - stop_process ((GPid) tmp, NULL); + nm_dhcp_client_stop_pid ((GPid) tmp, NULL, 0); } } @@ -387,7 +387,7 @@ nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name) } void -nm_dhcp_client_stop (NMDHCPClient *self) +nm_dhcp_client_stop (NMDHCPClient *self, gboolean release) { NMDHCPClientPrivate *priv; @@ -398,7 +398,7 @@ nm_dhcp_client_stop (NMDHCPClient *self) /* Kill the DHCP client */ if (!priv->dead) { - NM_DHCP_CLIENT_GET_CLASS (self)->stop (self); + NM_DHCP_CLIENT_GET_CLASS (self)->stop (self, release); priv->dead = TRUE; nm_log_info (LOGD_DHCP, "(%s): canceled DHCP transaction, DHCP client pid %d", |