diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c index 5b3b3f8ea6..3a056d3726 100644 --- a/src/dhcp-manager/nm-dhcp-client.c +++ b/src/dhcp-manager/nm-dhcp-client.c @@ -135,9 +135,9 @@ watch_cleanup (NMDHCPClient *self) } void -nm_dhcp_client_stop_pid (GPid pid, const char *iface, guint timeout_secs) +nm_dhcp_client_stop_pid (GPid pid, const char *iface) { - int i = (timeout_secs ? timeout_secs : 3) * 5; /* default 3 seconds */ + int i = 5; /* roughly 0.5 seconds */ g_return_if_fail (pid > 0); @@ -164,7 +164,7 @@ nm_dhcp_client_stop_pid (GPid pid, const char *iface, guint timeout_secs) break; } } - g_usleep (G_USEC_PER_SEC / 5); + g_usleep (G_USEC_PER_SEC / 10); } if (i <= 0) { @@ -193,7 +193,7 @@ stop (NMDHCPClient *self, gboolean release, const GByteArray *duid) /* Clean up the watch handler since we're explicitly killing the daemon */ watch_cleanup (self); - nm_dhcp_client_stop_pid (priv->pid, priv->iface, 0); + nm_dhcp_client_stop_pid (priv->pid, priv->iface); priv->info_only = FALSE; } @@ -518,7 +518,7 @@ nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name) exe = proc_contents; if (!strcmp (exe, binary_name)) - nm_dhcp_client_stop_pid ((GPid) tmp, NULL, 0); + nm_dhcp_client_stop_pid ((GPid) tmp, NULL); } } diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h index 930ec1a5e5..5cc1e39026 100644 --- a/src/dhcp-manager/nm-dhcp-client.h +++ b/src/dhcp-manager/nm-dhcp-client.h @@ -148,7 +148,7 @@ NMIP6Config *nm_dhcp_client_get_ip6_config (NMDHCPClient *self, gboolean test) /* Backend helpers */ void nm_dhcp_client_stop_existing (const char *pid_file, const char *binary_name); -void nm_dhcp_client_stop_pid (GPid pid, const char *iface, guint timeout_secs); +void nm_dhcp_client_stop_pid (GPid pid, const char *iface); #endif /* NM_DHCP_CLIENT_H */ diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c index d9ecdd9b74..d3677406c8 100644 --- a/src/dhcp-manager/nm-dhcp-dhclient.c +++ b/src/dhcp-manager/nm-dhcp-dhclient.c @@ -541,7 +541,7 @@ stop (NMDHCPClient *client, gboolean release, const GByteArray *duid) rpid = dhclient_start (client, NULL, duid, TRUE); if (rpid > 0) { /* Wait a few seconds for the release to happen */ - nm_dhcp_client_stop_pid (rpid, nm_dhcp_client_get_iface (client), 5); + nm_dhcp_client_stop_pid (rpid, nm_dhcp_client_get_iface (client)); } } }