]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/arm-ds5-gator.git/commitdiff
gator-daemon: Fix compilation error: 'sa_family_t' does not name a type
authorJon Medhurst <tixy@linaro.org>
Wed, 9 Apr 2014 15:09:46 +0000 (16:09 +0100)
committerJon Medhurst <tixy@linaro.org>
Wed, 9 Apr 2014 15:11:46 +0000 (16:11 +0100)
When compiling on Linaro Android we get the following error:

bionic/libc/kernel/common/linux/netlink.h:52:2: error: 'sa_family_t' does not name a type
  sa_family_t nl_family;

This is related to an issue that was fixed in Linux 3.1 by commit
6602a4baf4d1a73c (net: Make userland include of netlink.h more sane)
but it seems that the Linux headers used by bionic predate that.

Fortunately, the fix for us is simple: reorder the header file includes
so that the definition of sa_family_t from sys/socket.h is picked up
before being used by linux/netlink.h

Signed-off-by: Jon Medhurst <tixy@linaro.org>
daemon/UEvent.cpp

index 282e965fa67a98cb18e55fe9ee36c8401f01b8f9..d977cd080b4080e9fd091edb60625bf715b0656e 100644 (file)
@@ -8,9 +8,10 @@
 
 #include "UEvent.h"
 
 
 #include "UEvent.h"
 
+#include <sys/socket.h>
 #include <linux/netlink.h>
 #include <string.h>
 #include <linux/netlink.h>
 #include <string.h>
-#include <sys/socket.h>
+
 #include <unistd.h>
 
 #include "Logging.h"
 #include <unistd.h>
 
 #include "Logging.h"