示例#1
0
static DBusHandlerResult disconnect_filter(DBusConnection *conn,
					   DBusMessage *message, void *data)
{
	struct wpas_dbus_priv *priv = data;

	if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL,
				   "Disconnected")) {
		wpa_printf(MSG_DEBUG, "dbus: bus disconnected, terminating");
		dbus_connection_set_exit_on_disconnect(conn, FALSE);
		wpa_supplicant_terminate_proc(priv->global);
		return DBUS_HANDLER_RESULT_HANDLED;
	} else
		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
WPASupplicantApp::~WPASupplicantApp()
{
	if (fWPAGlobal == NULL)
		return;

	wpa_supplicant_terminate_proc(fWPAGlobal);

	// Wake the event loop up so it'll process the quit request and exit.
	_NotifyEventLoop();

	int32 result;
	wait_for_thread(fSupplicantThread, &result);

	wpa_supplicant_deinit(fWPAGlobal);

	close(fNotifySockets[0]);
	close(fNotifySockets[1]);
}