summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch')
-rw-r--r--meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
new file mode 100644
index 0000000000..804a62731d
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
@@ -0,0 +1,62 @@
1From: Marco Nenciarini <marco.nenciarini@devise.it>
2Date: Wed, 27 Jan 2010 19:46:21 +0100
3Subject: [PATCH] uuid: preserve -m option status in -v option handling
4
5Bug: 531396
6---
7 uuid_cli.c | 19 ++++++++++---------
8 1 files changed, 10 insertions(+), 9 deletions(-)
9
10----
11Upstream-Status: Inappropriate [not author]
12
13This patch is from debian ossp-uuid 1.6.2 integration.
14
15Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
16
17diff --git a/uuid_cli.c b/uuid_cli.c
18index d1b0b11..14a67fe 100644
19--- a/uuid_cli.c
20+++ b/uuid_cli.c
21@@ -140,11 +140,12 @@ int main(int argc, char *argv[])
22 i = strtol(optarg, &p, 10);
23 if (*p != '\0')
24 usage("invalid argument to option 'v'");
25+ version &= ~(UUID_MAKE_V1|UUID_MAKE_V3|UUID_MAKE_V4|UUID_MAKE_V5);
26 switch (i) {
27- case 1: version = UUID_MAKE_V1; break;
28- case 3: version = UUID_MAKE_V3; break;
29- case 4: version = UUID_MAKE_V4; break;
30- case 5: version = UUID_MAKE_V5; break;
31+ case 1: version |= UUID_MAKE_V1; break;
32+ case 3: version |= UUID_MAKE_V3; break;
33+ case 4: version |= UUID_MAKE_V4; break;
34+ case 5: version |= UUID_MAKE_V5; break;
35 default:
36 usage("invalid version on option 'v'");
37 break;
38@@ -213,10 +214,10 @@ int main(int argc, char *argv[])
39 }
40 else {
41 /* encoding */
42- if ( (version == UUID_MAKE_V1 && argc != 0)
43- || (version == UUID_MAKE_V3 && argc != 2)
44- || (version == UUID_MAKE_V4 && argc != 0)
45- || (version == UUID_MAKE_V5 && argc != 2))
46+ if ( (version & UUID_MAKE_V1 && argc != 0)
47+ || (version & UUID_MAKE_V3 && argc != 2)
48+ || (version & UUID_MAKE_V4 && argc != 0)
49+ || (version & UUID_MAKE_V5 && argc != 2))
50 usage("invalid number of arguments");
51 if ((rc = uuid_create(&uuid)) != UUID_RC_OK)
52 error(1, "uuid_create: %s", uuid_error(rc));
53@@ -232,7 +233,7 @@ int main(int argc, char *argv[])
54 if ((rc = uuid_load(uuid, "nil")) != UUID_RC_OK)
55 error(1, "uuid_load: %s", uuid_error(rc));
56 }
57- if (version == UUID_MAKE_V3 || version == UUID_MAKE_V5) {
58+ if (version & UUID_MAKE_V3 || version & UUID_MAKE_V5) {
59 if ((rc = uuid_create(&uuid_ns)) != UUID_RC_OK)
60 error(1, "uuid_create: %s", uuid_error(rc));
61 if ((rc = uuid_load(uuid_ns, argv[0])) != UUID_RC_OK) {
62--