Whamcloud - gitweb
gen_uuid.c (uuid_generate_time): Mask off the timestamp to avoid
authorTheodore Ts'o <tytso@mit.edu>
Wed, 5 May 2004 00:51:02 +0000 (20:51 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 5 May 2004 00:51:02 +0000 (20:51 -0400)
a Y8.8888K problem.

lib/uuid/ChangeLog
lib/uuid/gen_uuid.c

index fd665c5..ba1e63c 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-04  Theodore Ts'o  <tytso@mit.edu>
+
+       * gen_uuid.c (uuid_generate_time): Mask off the timestamp to avoid
+               a Y8.8888K problem.
+
 2004-04-03  Theodore Ts'o  <tytso@mit.edu>
 
        * Makefile.in: Update the modtime even if subst doesn't need to
index 3493649..30d6202 100644 (file)
@@ -283,7 +283,7 @@ void uuid_generate_time(uuid_t out)
        get_clock(&clock_mid, &uu.time_low, &uu.clock_seq);
        uu.clock_seq |= 0x8000;
        uu.time_mid = (uint16_t) clock_mid;
-       uu.time_hi_and_version = (clock_mid >> 16) | 0x1000;
+       uu.time_hi_and_version = ((clock_mid >> 16) & 0x0FFF) | 0x1000;
        memcpy(uu.node, node_id, 6);
        uuid_pack(&uu, out);
 }