static gboolean pppd_timed_out (gpointer data) { NMPPPManager *manager = NM_PPP_MANAGER (data); nm_log_warn (LOGD_PPP, "pppd timed out or didn't initialize our dbus module"); _ppp_cleanup (manager); g_signal_emit (manager, signals[STATE_CHANGED], 0, NM_PPP_STATUS_DEAD); return FALSE; }
static void dispose (GObject *object) { NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); _ppp_cleanup (NM_PPP_MANAGER (object)); _ppp_kill (NM_PPP_MANAGER (object)); g_clear_object (&priv->act_req); G_OBJECT_CLASS (nm_ppp_manager_parent_class)->dispose (object); }
static void dispose (GObject *object) { NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (object); if (priv->disposed == FALSE) { priv->disposed = TRUE; _ppp_cleanup (NM_PPP_MANAGER (object)); if (priv->act_req) { g_object_unref (priv->act_req); priv->act_req = NULL; } g_object_unref (priv->dbus_manager); priv->dbus_manager = NULL; } G_OBJECT_CLASS (nm_ppp_manager_parent_class)->dispose (object); }
void nm_ppp_manager_stop (NMPPPManager *manager, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { NMPPPManagerPrivate *priv = NM_PPP_MANAGER_GET_PRIVATE (manager); StopContext *ctx; ctx = g_slice_new0 (StopContext); ctx->manager = g_object_ref (manager); ctx->result = g_simple_async_result_new (G_OBJECT (manager), callback, user_data, nm_ppp_manager_stop); /* Setup cancellable */ ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL; if (stop_context_complete_if_cancelled (ctx)) return; /* Cleanup internals */ _ppp_cleanup (manager); /* If no pppd running, we're done */ if (!priv->pid) { stop_context_complete (ctx); return; } /* No cancellable operation, so just wait until it returns always */ nm_utils_kill_child_async (priv->pid, SIGTERM, LOGD_PPP, "pppd", 2000, (NMUtilsKillChildAsyncCb) kill_child_ready, ctx); priv->pid = 0; }