summaryrefslogtreecommitdiff
path: root/src/ppp-manager
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-01-04 09:46:22 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2016-01-06 21:25:55 +0100
commitfbd32869553dd631c486530a2e543c31041af5c2 (patch)
tree9e544a1e2099ecd151d5213eb81ed2e839b33462 /src/ppp-manager
parent205ae642f9e45ee911a688356bcba1e5b7646601 (diff)
downloadNetworkManager-fbd32869553dd631c486530a2e543c31041af5c2.tar.gz
core,libnm: use nm_clear_g_source() where possible
Replacement was done with commands: spatch --sp-file nm_clear_g_source.cocci --in-place --smpl-spacing --dir src spatch --sp-file nm_clear_g_source.cocci --in-place --smpl-spacing --dir libnm where nm_clear_g_source.cocci contains: @@ expression e; @@ - if (e) { - g_source_remove (e); - e = 0; - } + nm_clear_g_source (&e);
Diffstat (limited to 'src/ppp-manager')
-rw-r--r--src/ppp-manager/nm-ppp-manager.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c
index 49f7075347..10bc0fecea 100644
--- a/src/ppp-manager/nm-ppp-manager.c
+++ b/src/ppp-manager/nm-ppp-manager.c
@@ -222,10 +222,7 @@ remove_timeout_handler (NMPPPManager *manager)
{
NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager);
- if (priv->ppp_timeout_handler) {
- g_source_remove (priv->ppp_timeout_handler);
- priv->ppp_timeout_handler = 0;
- }
+ nm_clear_g_source (&priv->ppp_timeout_handler);
}
static void
@@ -1125,10 +1122,7 @@ _ppp_cleanup (NMPPPManager *manager)
cancel_get_secrets (manager);
- if (priv->monitor_id) {
- g_source_remove (priv->monitor_id);
- priv->monitor_id = 0;
- }
+ nm_clear_g_source (&priv->monitor_id);
if (priv->monitor_fd >= 0) {
/* Get the stats one last time */
@@ -1137,15 +1131,8 @@ _ppp_cleanup (NMPPPManager *manager)
priv->monitor_fd = -1;
}
- if (priv->ppp_timeout_handler) {
- g_source_remove (priv->ppp_timeout_handler);
- priv->ppp_timeout_handler = 0;
- }
-
- if (priv->ppp_watch_id) {
- g_source_remove (priv->ppp_watch_id);
- priv->ppp_watch_id = 0;
- }
+ nm_clear_g_source (&priv->ppp_timeout_handler);
+ nm_clear_g_source (&priv->ppp_watch_id);
}
/***********************************************************/