iproute2: fixes to compile on some systems.
Subsystems (2)
PATCH 1/1 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.
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
--- include/bpf_scm.h | 1 + include/utils.h | 3 +++ 2 files changed, 4 insertions(+)
include/bpf_scm.h +1 -0
@@ -3,6 +3,7 @@#include <sys/types.h> #include <sys/socket.h> +#include <sys/un.h> #include "utils.h" #include "bpf_elf.h"
include/utils.h +3 -0
@@ -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__ */
Signature · 1 line
2.15.0.448.gf294e3d99a-goog
Stephen Hemminger
AppliedQuoted 9 lines · On Mon, 20 Nov 2017 12:57:07 +0900 Lorenzo Colitti <[email protected]> wrote:
1. Put the declarations of strlcpy and strlcat inside an #ifdef
NEED_STRLCPY. Their declarations were already in a similar #ifdef.
2. Inbpf_scm.h, includesys/un.hfor structsockaddr_un.
3. Inutils.h, includetime.hfor struct timeval.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 codeSigned-off-by Lorenzo Colitti <[email protected]>
Applied. Thanks for not forking