aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/uuid/uuid_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/uuid/uuid_time.c')
-rw-r--r--e2fsprogs/uuid/uuid_time.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/e2fsprogs/uuid/uuid_time.c b/e2fsprogs/uuid/uuid_time.c
index d5f992b39..9ff3607d8 100644
--- a/e2fsprogs/uuid/uuid_time.c
+++ b/e2fsprogs/uuid/uuid_time.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * uuid_time.c --- Interpret the time field from a uuid. This program 2 * uuid_time.c --- Interpret the time field from a uuid. This program
3 * violates the UUID abstraction barrier by reaching into the guts 3 * violates the UUID abstraction barrier by reaching into the guts
4 * of a UUID and interpreting it. 4 * of a UUID and interpreting it.
5 * 5 *
6 * Copyright (C) 1998, 1999 Theodore Ts'o. 6 * Copyright (C) 1998, 1999 Theodore Ts'o.
7 * 7 *
8 * %Begin-Header% 8 * %Begin-Header%
@@ -18,7 +18,7 @@
18 * 3. The name of the author may not be used to endorse or promote 18 * 3. The name of the author may not be used to endorse or promote
19 * products derived from this software without specific prior 19 * products derived from this software without specific prior
20 * written permission. 20 * written permission.
21 * 21 *
22 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF 24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
@@ -51,7 +51,7 @@ time_t uuid_time(const uuid_t uu, struct timeval *ret_tv)
51 unsigned long long clock_reg; 51 unsigned long long clock_reg;
52 52
53 uuid_unpack(uu, &uuid); 53 uuid_unpack(uu, &uuid);
54 54
55 high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16); 55 high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16);
56 clock_reg = uuid.time_low | ((unsigned long long) high << 32); 56 clock_reg = uuid.time_low | ((unsigned long long) high << 32);
57 57
@@ -69,7 +69,7 @@ int uuid_type(const uuid_t uu)
69{ 69{
70 struct uuid uuid; 70 struct uuid uuid;
71 71
72 uuid_unpack(uu, &uuid); 72 uuid_unpack(uu, &uuid);
73 return ((uuid.time_hi_and_version >> 12) & 0xF); 73 return ((uuid.time_hi_and_version >> 12) & 0xF);
74} 74}
75 75
@@ -78,7 +78,7 @@ int uuid_variant(const uuid_t uu)
78 struct uuid uuid; 78 struct uuid uuid;
79 int var; 79 int var;
80 80
81 uuid_unpack(uu, &uuid); 81 uuid_unpack(uu, &uuid);
82 var = uuid.clock_seq; 82 var = uuid.clock_seq;
83 83
84 if ((var & 0x8000) == 0) 84 if ((var & 0x8000) == 0)
@@ -105,7 +105,7 @@ static const char *variant_string(int variant)
105 } 105 }
106} 106}
107 107
108 108
109int 109int
110main(int argc, char **argv) 110main(int argc, char **argv)
111{ 111{
@@ -155,7 +155,7 @@ main(int argc, char **argv)
155 } 155 }
156 printf("UUID time is: (%ld, %ld): %s\n", tv.tv_sec, tv.tv_usec, 156 printf("UUID time is: (%ld, %ld): %s\n", tv.tv_sec, tv.tv_usec,
157 ctime(&time_reg)); 157 ctime(&time_reg));
158 158
159 return 0; 159 return 0;
160} 160}
161#endif 161#endif