From 06a40dcf737e1732ad6c568b9533ed19fdc40bca Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 30 Oct 2009 11:39:19 -0700 Subject: [PATCH] core: move helper macro for activating state to general location --- src/NetworkManagerPolicy.c | 4 +--- src/nm-device-interface.h | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index 6c34de8cf6..5b860aae0a 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -42,8 +42,6 @@ #include "nm-vpn-manager.h" #include "nm-modem.h" -#define STATE_IN_ACTIVATION_PHASE(state) ((state > NM_DEVICE_STATE_DISCONNECTED) && (state < NM_DEVICE_STATE_ACTIVATED)) - typedef struct LookupThread LookupThread; typedef void (*LookupCallback) (LookupThread *thread, gpointer user_data); @@ -788,7 +786,7 @@ device_state_changed (NMDevice *device, /* Mark the connection invalid if it failed during activation so that * it doesn't get automatically chosen over and over and over again. */ - if (connection && STATE_IN_ACTIVATION_PHASE (old_state)) { + if (connection && IS_ACTIVATING_STATE (old_state)) { g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); nm_info ("Marking connection '%s' invalid.", get_connection_id (connection)); nm_connection_clear_secrets (connection); diff --git a/src/nm-device-interface.h b/src/nm-device-interface.h index 0867bc2923..54b5c41a59 100644 --- a/src/nm-device-interface.h +++ b/src/nm-device-interface.h @@ -32,6 +32,9 @@ #define NM_IS_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INTERFACE)) #define NM_DEVICE_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface)) +#define IS_ACTIVATING_STATE(state) \ + (state > NM_DEVICE_STATE_DISCONNECTED && state < NM_DEVICE_STATE_ACTIVATED) + typedef enum { NM_DEVICE_INTERFACE_ERROR_CONNECTION_ACTIVATING = 0,