diff options
author | Dan Williams <dcbw@redhat.com> | 2009-10-30 11:39:19 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2009-10-30 11:39:19 -0700 |
commit | 06a40dcf737e1732ad6c568b9533ed19fdc40bca (patch) | |
tree | bf7b6433ad4a0393c42632818abfb80066ce4f25 | |
parent | 671f00c86f047dfe57f43726a0eefadaad6f2734 (diff) |
core: move helper macro for activating state to general location
-rw-r--r-- | src/NetworkManagerPolicy.c | 4 | ||||
-rw-r--r-- | 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, |