diff options
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.patch | 55 |
1 files changed, 55 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..1467207f51 --- /dev/null +++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From: Marco Nenciarini <marco.nenciarini@devise.it> | ||
2 | Date: Wed, 27 Jan 2010 19:46:21 +0100 | ||
3 | Subject: [PATCH] uuid: preserve -m option status in -v option handling | ||
4 | |||
5 | Bug: 531396 | ||
6 | --- | ||
7 | uuid_cli.c | 19 ++++++++++--------- | ||
8 | 1 files changed, 10 insertions(+), 9 deletions(-) | ||
9 | |||
10 | diff --git a/uuid_cli.c b/uuid_cli.c | ||
11 | index d1b0b11..14a67fe 100644 | ||
12 | --- a/uuid_cli.c | ||
13 | +++ b/uuid_cli.c | ||
14 | @@ -140,11 +140,12 @@ int main(int argc, char *argv[]) | ||
15 | i = strtol(optarg, &p, 10); | ||
16 | if (*p != '\0') | ||
17 | usage("invalid argument to option 'v'"); | ||
18 | + version &= ~(UUID_MAKE_V1|UUID_MAKE_V3|UUID_MAKE_V4|UUID_MAKE_V5); | ||
19 | switch (i) { | ||
20 | - case 1: version = UUID_MAKE_V1; break; | ||
21 | - case 3: version = UUID_MAKE_V3; break; | ||
22 | - case 4: version = UUID_MAKE_V4; break; | ||
23 | - case 5: version = UUID_MAKE_V5; break; | ||
24 | + case 1: version |= UUID_MAKE_V1; break; | ||
25 | + case 3: version |= UUID_MAKE_V3; break; | ||
26 | + case 4: version |= UUID_MAKE_V4; break; | ||
27 | + case 5: version |= UUID_MAKE_V5; break; | ||
28 | default: | ||
29 | usage("invalid version on option 'v'"); | ||
30 | break; | ||
31 | @@ -213,10 +214,10 @@ int main(int argc, char *argv[]) | ||
32 | } | ||
33 | else { | ||
34 | /* encoding */ | ||
35 | - if ( (version == UUID_MAKE_V1 && argc != 0) | ||
36 | - || (version == UUID_MAKE_V3 && argc != 2) | ||
37 | - || (version == UUID_MAKE_V4 && argc != 0) | ||
38 | - || (version == UUID_MAKE_V5 && argc != 2)) | ||
39 | + if ( (version & UUID_MAKE_V1 && argc != 0) | ||
40 | + || (version & UUID_MAKE_V3 && argc != 2) | ||
41 | + || (version & UUID_MAKE_V4 && argc != 0) | ||
42 | + || (version & UUID_MAKE_V5 && argc != 2)) | ||
43 | usage("invalid number of arguments"); | ||
44 | if ((rc = uuid_create(&uuid)) != UUID_RC_OK) | ||
45 | error(1, "uuid_create: %s", uuid_error(rc)); | ||
46 | @@ -232,7 +233,7 @@ int main(int argc, char *argv[]) | ||
47 | if ((rc = uuid_load(uuid, "nil")) != UUID_RC_OK) | ||
48 | error(1, "uuid_load: %s", uuid_error(rc)); | ||
49 | } | ||
50 | - if (version == UUID_MAKE_V3 || version == UUID_MAKE_V5) { | ||
51 | + if (version & UUID_MAKE_V3 || version & UUID_MAKE_V5) { | ||
52 | if ((rc = uuid_create(&uuid_ns)) != UUID_RC_OK) | ||
53 | error(1, "uuid_create: %s", uuid_error(rc)); | ||
54 | if ((rc = uuid_load(uuid_ns, argv[0])) != UUID_RC_OK) { | ||
55 | -- | ||