diff options
author | Fabian Groffen | 2011-01-21 17:48:14 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-23 22:17:14 +0100 |
commit | d58c47d9a49805157ff0669afe02fa4f9d8adf78 (patch) | |
tree | 6bd8e603aa195bed3b2f0127135afdff1cceec9c /shlibs/blkid/src/read.c | |
parent | lib: [xalloc] don't use hardcoded return code (diff) | |
download | kernel-qcow2-util-linux-d58c47d9a49805157ff0669afe02fa4f9d8adf78.tar.gz kernel-qcow2-util-linux-d58c47d9a49805157ff0669afe02fa4f9d8adf78.tar.xz kernel-qcow2-util-linux-d58c47d9a49805157ff0669afe02fa4f9d8adf78.zip |
include: emulate dirfd when necessary
dirfd is not available on Solaris 10, it is available on latest
OpenSolaris releases though. Do some autoconf trickery to determine if
providing an alternative dirfd function is necessary and possible.
shlibs/blkid/src/read.c: Do not define _XOPEN_SOURCE to 600, or DIR will
lose it's dd_fd member again. Rearrange defines and includes to make
sense per comments, and not conflict on Solaris.
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'shlibs/blkid/src/read.c')
-rw-r--r-- | shlibs/blkid/src/read.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/shlibs/blkid/src/read.c b/shlibs/blkid/src/read.c index e6aa08368..3ff9ebe9f 100644 --- a/shlibs/blkid/src/read.c +++ b/shlibs/blkid/src/read.c @@ -10,7 +10,6 @@ * %End-Header% */ -#define _XOPEN_SOURCE 600 /* for inclusion of strtoull */ #include <stdio.h> #include <ctype.h> @@ -26,6 +25,13 @@ #include "blkidP.h" +#if HAVE_STDLIB_H +# ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE 600 /* for inclusion of strtoull */ +# endif +# include <stdlib.h> +#endif + #ifdef HAVE_STRTOULL #define STRTOULL strtoull /* defined in stdlib.h if you try hard enough */ #else @@ -33,10 +39,6 @@ #define STRTOULL strtoul #endif -#if HAVE_STDLIB_H -#include <stdlib.h> -#endif - #ifdef TEST_PROGRAM #define blkid_debug_dump_dev(dev) (debug_dump_dev(dev)) static void debug_dump_dev(blkid_dev dev); |