]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: assume strtoull() is available
authorSami Kerola <kerolasa@iki.fi>
Wed, 7 Jan 2015 22:05:43 +0000 (22:05 +0000)
committerSami Kerola <kerolasa@iki.fi>
Wed, 7 Jan 2015 22:05:43 +0000 (22:05 +0000)
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 <kerolasa@iki.fi>
configure.ac
libblkid/src/read.c

index a5bfc61fab7d8d4ebda7175ab2443fb89822e771..31197abc2e4011cb78942c64fbc99d49d6266135 100644 (file)
@@ -356,7 +356,6 @@ AC_CHECK_FUNCS([ \
        strnchr \
        strndup \
        strnlen \
-       strtoull \
        sysconf \
        sysinfo \
        updwtmp \
index 81ab0dfd67679505cee3f9e1fa37a2be5cb30338..41e564f4e31e416e3128b755534488def7d6742d 100644 (file)
 # include <stdlib.h>
 #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));