built_in: improved to define DEFFILEMODE if not provided by the libc
commitdf15ea3f90cc6b16c1029ff9994b1f8ca5519d2c
authorChristian Wiese <chris@opensde.org>
Thu, 10 Apr 2014 11:59:25 +0000 (10 13:59 +0200)
committerDaniel Borkmann <dborkman@redhat.com>
Thu, 10 Apr 2014 12:47:07 +0000 (10 14:47 +0200)
tree261244ea04c0a1841916f8d5d9e35cf94e116f20
parent70959ae3467fdf39fb4303adfebafcbd00e4f637
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>
built_in.h