public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 3/4] uuidgen: use type definitions from uuid.h
Date: Sun, 25 May 2014 11:59:39 +0100	[thread overview]
Message-ID: <1401015580-27951-3-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1401015580-27951-1-git-send-email-kerolasa@iki.fi>

There is no need to re-invent wheel.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 misc-utils/uuidgen.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c
index 450e26a..0c844d2 100644
--- a/misc-utils/uuidgen.c
+++ b/misc-utils/uuidgen.c
@@ -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:
-- 
1.9.3


  parent reply	other threads:[~2014-05-25 10:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-25 10:59 [PATCH 1/4] uuidd: ensure pid file is wrote when it is requested Sami Kerola
2014-05-25 10:59 ` [PATCH 2/4] uuidd: set options to be mutually exclusive Sami Kerola
2014-05-26  9:50   ` Karel Zak
2014-05-26 15:49     ` Sami Kerola
2014-05-25 10:59 ` Sami Kerola [this message]
2014-05-25 10:59 ` [PATCH 4/4] uuidd: do not mix signed type and unsigned code Sami Kerola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401015580-27951-3-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox