From df15ea3f90cc6b16c1029ff9994b1f8ca5519d2c Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Thu, 10 Apr 2014 13:59:25 +0200 Subject: built_in: improved to define DEFFILEMODE if not provided by the libc musl libc doesn't provide the non-standard macros for common mode bit masks, which other libc implementations like glibc define in . Compile time error when building against musl libc: -------------------------------------------------------------------------- netsniff-ng.c: In function 'read_pcap': netsniff-ng.c:592:33: error: 'DEFFILEMODE' undeclared (first use in this function) -------------------------------------------------------------------------- This change improves built_in.h to check if DEFFILEMODE is defined and if not it defines it to be available internally. Signed-off-by: Christian Wiese Signed-off-by: Daniel Borkmann --- built_in.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/built_in.h b/built_in.h index d7d4b6b..a3b7bf8 100644 --- a/built_in.h +++ b/built_in.h @@ -406,4 +406,8 @@ static inline u64 cpu_to_le64(u64 val) # define PACKET_KERNEL 7 #endif +#ifndef DEFFILEMODE +# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) /* 0666 */ +#endif + #endif /* BUILT_IN_H */ -- cgit v1.2.3-54-g00ecf