From: Theodore Ts'o Date: Mon, 21 Mar 2016 17:09:54 +0000 (-0400) Subject: libext2fs: make sure ismounted.c explicitly pulls in X-Git-Tag: v1.43-WIP-2016-05-12~40^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f6f8602dc1037fb8fc2051fb062c0209f8baa2a;p=thirdparty%2Fe2fsprogs.git libext2fs: make sure ismounted.c explicitly pulls in The major() cpp macro is defined as requiring sys/types.h to be included with _BSD_SOURCE defined. However, in older glibc's this hasn't been strictly required and the stdlib.h header file included sys/types.h implicitly. Fix this so that more aggressive distributions run into build errors. Signed-off-by: Theodore Ts'o in with andchanges. Lines starting --- diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c index 6c6ecff0e..6e682ad96 100644 --- a/lib/ext2fs/ismounted.c +++ b/lib/ext2fs/ismounted.c @@ -9,6 +9,14 @@ * %End-Header% */ +/* define BSD_SOURCE to make sure we get the major() macro */ +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE /* since glibc 2.20 _SVID_SOURCE is deprecated */ +#endif + #include "config.h" #include #if HAVE_UNISTD_H @@ -38,6 +46,9 @@ #endif /* HAVE_GETMNTINFO */ #include #include +#if HAVE_SYS_TYPES_H +#include +#endif #include "ext2_fs.h" #include "ext2fs.h"