From 00f2b0a9bb806be64c5868af44f43dbe55bdd75b Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Fri, 23 Sep 2011 13:46:41 +0200 Subject: [PATCH] core: Include instead of NM already includes in some places, f.e. nm-netlink-monitor and we can't mix usage of the two. Stick to using as it provides additional flag definitions such as operational link state and link mode. Signed-off-by: Thomas Graf --- include/wireless-helper.h | 2 +- src/nm-device.c | 2 +- src/nm-system.c | 2 +- src/ppp-manager/nm-ppp-manager.c | 2 +- src/settings/plugins/ifcfg-rh/reader.c | 2 +- src/wimax/iwmxsdk.c | 24 ++++++++---------------- src/wimax/nm-device-wimax.c | 3 ++- 7 files changed, 15 insertions(+), 22 deletions(-) diff --git a/include/wireless-helper.h b/include/wireless-helper.h index d150ef7df..2e4509a86 100644 --- a/include/wireless-helper.h +++ b/include/wireless-helper.h @@ -27,6 +27,6 @@ #include #include #include -#include +#include #include diff --git a/src/nm-device.c b/src/nm-device.c index c0b1b8740..559606cb0 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include #include "nm-glib-compat.h" #include "nm-device-interface.h" diff --git a/src/nm-system.c b/src/nm-system.c index 0b294684e..473fcec5b 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "nm-system.h" #include "nm-device.h" diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index 522c0751e..3546f8d74 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 691a176a4..910cca358 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -28,10 +28,10 @@ #include #include #include -#include #include #include #include +#include #ifndef __user #define __user diff --git a/src/wimax/iwmxsdk.c b/src/wimax/iwmxsdk.c index ff6b553a8..9c3a78bb8 100644 --- a/src/wimax/iwmxsdk.c +++ b/src/wimax/iwmxsdk.c @@ -27,7 +27,8 @@ #include #include #include -#include +#include +#include #include @@ -1315,23 +1316,22 @@ void wmxsdk_unref(struct wmxsdk *wmxsdk) static void iwmx_sdk_dev_add(unsigned idx, unsigned api_idx, const char *name) { - int ifindex; struct wmxsdk *wmxsdk; const char *s; if (idx >= IWMX_SDK_DEV_MAX) { nm_log_err(LOGD_WIMAX, "BUG! idx (%u) >= IWMX_SDK_DEV_MAX (%u)", idx, IWMX_SDK_DEV_MAX); - goto error_bug; + return; } if (g_iwmx_sdk_devs[idx] != NULL) { nm_log_err(LOGD_WIMAX, "BUG! device index %u already enumerated?", idx); - goto error_bug; + return; } wmxsdk = wmxsdk_new(); if (wmxsdk == NULL) { nm_log_err(LOGD_WIMAX, "Can't allocate %zu bytes", sizeof(*wmxsdk)); - goto error_bug; + return; } /* @@ -1344,23 +1344,17 @@ static void iwmx_sdk_dev_add(unsigned idx, unsigned api_idx, const char *name) || sscanf(s, "if:%15[^ \f\n\r\t\v]", wmxsdk->ifname) != 1) { nm_log_err(LOGD_WIMAX, "Cannot extract network interface name off '%s'", name); - goto error_noifname; + goto error; } nm_log_dbg(LOGD_WIMAX, "network interface name: '%s'", wmxsdk->ifname); - ifindex = if_nametoindex(wmxsdk->ifname); - if (ifindex <= 0) { - nm_log_err(LOGD_WIMAX, "wxmsdk: %s: cannot find interface index", wmxsdk->ifname); - goto error_noifname; - } - strncpy(wmxsdk->name, name, sizeof(wmxsdk->name)); wmxsdk->device_id.privilege = WIMAX_API_PRIVILEGE_READ_WRITE; wmxsdk->device_id.deviceIndex = api_idx; if (iwmx_sdk_setup(wmxsdk) != 0) { nm_log_err(LOGD_WIMAX, "wxmsdk: %s: cannot set up interface", wmxsdk->ifname); - goto error_setup; + goto error; } g_iwmx_sdk_devs[idx] = wmxsdk; @@ -1369,10 +1363,8 @@ static void iwmx_sdk_dev_add(unsigned idx, unsigned api_idx, const char *name) iwmx_sdk_call_new_callbacks (wmxsdk); return; -error_setup: -error_noifname: +error: wmxsdk_unref(wmxsdk); -error_bug: return; } diff --git a/src/wimax/nm-device-wimax.c b/src/wimax/nm-device-wimax.c index b6afc273e..665414072 100644 --- a/src/wimax/nm-device-wimax.c +++ b/src/wimax/nm-device-wimax.c @@ -23,7 +23,8 @@ #include #include #include -#include +#include +#include #include #include