[glib] gnetworkmonitornetlink.c: Fix compilation on RHEL 6.2
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gnetworkmonitornetlink.c: Fix compilation on RHEL 6.2
- Date: Tue, 13 Dec 2011 15:46:07 +0000 (UTC)
commit f3dde2d4057f5dfa5cbc9f1e3f13d596608b0b3b
Author: Christophe Fergeau <cfergeau redhat com>
Date: Mon Dec 12 15:06:41 2011 +0100
gnetworkmonitornetlink.c: Fix compilation on RHEL 6.2
When trying to compile glib master on a RHEL 6.2 system, it fails with:
make[4]: Entering directory `/home/teuf/gnome/src/glib/gio'
CC libgio_2_0_la-gnetworkmonitornetlink.lo
In file included from gnetworkmonitornetlink.c:25:
/usr/include/linux/netlink.h:35: error: expected specifier-qualifier-list before 'sa_family_t'
gnetworkmonitornetlink.c: In function 'g_network_monitor_netlink_initable_init':
gnetworkmonitornetlink.c:99: error: 'struct sockaddr_nl' has no member named 'nl_family'
gnetworkmonitornetlink.c:100: error: 'struct sockaddr_nl' has no member named 'nl_pid'
gnetworkmonitornetlink.c:100: error: 'struct sockaddr_nl' has no member named 'nl_pad'
gnetworkmonitornetlink.c:101: error: 'struct sockaddr_nl' has no member named 'nl_groups'
make[4]: *** [libgio_2_0_la-gnetworkmonitornetlink.lo] Error 1
sa_family_t is defined in sys/socket.h, this commit makes sure this header is included before netlink.h
This fixes bgo bug #666001
gio/gnetworkmonitornetlink.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c
index 046c9e9..ecdc0d4 100644
--- a/gio/gnetworkmonitornetlink.c
+++ b/gio/gnetworkmonitornetlink.c
@@ -22,8 +22,6 @@
#include <errno.h>
#include <unistd.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
#include "gnetworkmonitornetlink.h"
#include "gcredentials.h"
@@ -36,6 +34,11 @@
#include "gsocket.h"
#include "gunixcredentialsmessage.h"
+/* must come at the end to pick system includes from
+ * gnetworkingprivate.h */
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
static void g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *iface);
static void g_network_monitor_netlink_initable_iface_init (GInitableIface *iface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]