From: Sami Kerola Date: Wed, 7 Jan 2015 22:05:43 +0000 (+0000) Subject: libblkid: assume strtoull() is available X-Git-Tag: v2.26-rc1~62^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9385a11d8d5d1468a15e02cb1a74b2472be993bc;p=thirdparty%2Futil-linux.git libblkid: assume strtoull() is available The strtoull() is part of ISO/IEC 9899:1999 (aka C99) and the function has been happily used in prlimit(1) since 2011-10-19 without anyone complaining compatibility issues. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/strtoul.html Signed-off-by: Sami Kerola --- diff --git a/configure.ac b/configure.ac index a5bfc61fab..31197abc2e 100644 --- a/configure.ac +++ b/configure.ac @@ -356,7 +356,6 @@ AC_CHECK_FUNCS([ \ strnchr \ strndup \ strnlen \ - strtoull \ sysconf \ sysinfo \ updwtmp \ diff --git a/libblkid/src/read.c b/libblkid/src/read.c index 81ab0dfd67..41e564f4e3 100644 --- a/libblkid/src/read.c +++ b/libblkid/src/read.c @@ -32,13 +32,6 @@ # include #endif -#ifdef HAVE_STRTOULL -#define STRTOULL strtoull /* defined in stdlib.h if you try hard enough */ -#else -/* FIXME: need to support real strtoull here */ -#define STRTOULL strtoul -#endif - #ifdef TEST_PROGRAM #define blkid_debug_dump_dev(dev) (debug_dump_dev(dev)) static void debug_dump_dev(blkid_dev dev); @@ -330,14 +323,14 @@ static int parse_tag(blkid_cache cache, blkid_dev dev, char **cp) /* Some tags are stored directly in the device struct */ if (!strcmp(name, "DEVNO")) - dev->bid_devno = STRTOULL(value, 0, 0); + dev->bid_devno = strtoull(value, 0, 0); else if (!strcmp(name, "PRI")) dev->bid_pri = strtol(value, 0, 0); else if (!strcmp(name, "TIME")) { char *end = NULL; - dev->bid_time = STRTOULL(value, &end, 0); + dev->bid_time = strtoull(value, &end, 0); if (end && *end == '.') - dev->bid_utime = STRTOULL(end + 1, 0, 0); + dev->bid_utime = strtoull(end + 1, 0, 0); } else ret = blkid_set_tag(dev, name, value, strlen(value));