aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2017-11-20 12:57:07 +0900
committerLorenzo Colitti <lorenzo@google.com>2017-11-21 23:51:09 +0900
commit1c4b05b06ab25573b4e3eccda5c2a2b33dcbe3c0 (patch)
tree5545a713b62bb1bf020666ffeca9b8444b892a33
parent13dd0e3473538377ce938b4eee1e22940cfb8ee0 (diff)
downloadplatform_external_iproute2-1c4b05b06ab25573b4e3eccda5c2a2b33dcbe3c0.tar.gz
platform_external_iproute2-1c4b05b06ab25573b4e3eccda5c2a2b33dcbe3c0.tar.bz2
platform_external_iproute2-1c4b05b06ab25573b4e3eccda5c2a2b33dcbe3c0.zip
iproute2: fixes to compile on some systems.
1. Put the declarations of strlcpy and strlcat inside an #ifdef NEED_STRLCPY. Their declarations were already in a similar #ifdef. 2. In bpf_scm.h, include sys/un.h for struct sockaddr_un. 3. In utils.h, include time.h for struct timeval. [Cherry-pick of upstream 05b3b344b2498d600ca2ad482778b64891fe6bf7] Tested: builds on ubuntu 14.04 with "make clean distclean; ./configure && make -j64" Tested: 4.14.1 builds on Android with Android-specific #ifndefs for missing library code Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Change-Id: If21f95e2e8d87c7d42f8493d5ae70a12b634d065
-rw-r--r--include/bpf_scm.h1
-rw-r--r--include/utils.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/include/bpf_scm.h b/include/bpf_scm.h
index 35117d11..122d59fc 100644
--- a/include/bpf_scm.h
+++ b/include/bpf_scm.h
@@ -3,6 +3,7 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/un.h>
#include "utils.h"
#include "bpf_elf.h"
diff --git a/include/utils.h b/include/utils.h
index 3d91c50d..10749fbe 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -6,6 +6,7 @@
#include <resolv.h>
#include <stdlib.h>
#include <stdbool.h>
+#include <time.h>
#include "libnetlink.h"
#include "ll_map.h"
@@ -256,7 +257,9 @@ int make_path(const char *path, mode_t mode);
char *find_cgroup2_mount(void);
int get_command_name(const char *pid, char *comm, size_t len);
+#ifdef NEED_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t size);
size_t strlcat(char *dst, const char *src, size_t size);
+#endif
#endif /* __UTILS_H__ */