]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
uuidgen: use type definitions from uuid.h
authorSami Kerola <kerolasa@iki.fi>
Sat, 24 May 2014 17:41:08 +0000 (18:41 +0100)
committerSami Kerola <kerolasa@iki.fi>
Mon, 26 May 2014 15:42:49 +0000 (16:42 +0100)
There is no need to re-invent wheel.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/uuidgen.c

index 450e26a0535b9dca220fb976649565c07eac4d21..0c844d21659fba0121bdbc48da7e9dbe22cf8768 100644 (file)
@@ -26,9 +26,6 @@ extern int optind;
 #include "c.h"
 #include "closestream.h"
 
-#define DO_TYPE_TIME   1
-#define DO_TYPE_RANDOM 2
-
 static void __attribute__ ((__noreturn__)) usage(FILE * out)
 {
        fputs(_("\nUsage:\n"), out);
@@ -68,10 +65,10 @@ main (int argc, char *argv[])
        while ((c = getopt_long(argc, argv, "rtVh", longopts, NULL)) != -1)
                switch (c) {
                case 't':
-                       do_type = DO_TYPE_TIME;
+                       do_type = UUID_TYPE_DCE_TIME;
                        break;
                case 'r':
-                       do_type = DO_TYPE_RANDOM;
+                       do_type = UUID_TYPE_DCE_RANDOM;
                        break;
                case 'V':
                        printf(UTIL_LINUX_VERSION);
@@ -83,10 +80,10 @@ main (int argc, char *argv[])
                }
 
        switch (do_type) {
-       case DO_TYPE_TIME:
+       case UUID_TYPE_DCE_TIME:
                uuid_generate_time(uu);
                break;
-       case DO_TYPE_RANDOM:
+       case UUID_TYPE_DCE_RANDOM:
                uuid_generate_random(uu);
                break;
        default: