diff options
author | Christian Wiese <chris@opensde.org> | 2014-04-10 13:59:25 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2014-04-10 14:47:07 +0200 |
commit | df15ea3f90cc6b16c1029ff9994b1f8ca5519d2c (patch) | |
tree | 261244ea04c0a1841916f8d5d9e35cf94e116f20 /built_in.h | |
parent | 70959ae3467fdf39fb4303adfebafcbd00e4f637 (diff) |
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
<sys/stat.h>.
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 <chris@opensde.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'built_in.h')
-rw-r--r-- | built_in.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 */ |