# HG changeset patch # User Josef 'Jeff' Sipek # Date 1496656556 -10800 # Node ID 69f9d0c724a3d45137c64153a83baa169371946d # Parent 9ccf1fdb6303716d385c9f5596595cfa4c504b76 lib: guid_128_generate() shouldn't generate invalid timestamps The nsec validity check must take into account the soon-to-be-done increment. diff -r 9ccf1fdb6303 -r 69f9d0c724a3 src/lib/guid.c --- a/src/lib/guid.c Mon Jun 05 12:53:23 2017 +0300 +++ b/src/lib/guid.c Mon Jun 05 12:55:56 2017 +0300 @@ -75,7 +75,7 @@ when a GUID was created. */ ts.tv_sec = ioloop_timeval.tv_sec; ts.tv_nsec = ioloop_timeval.tv_usec*1000; - } else if ((uint32_t)ts.tv_nsec < 1000000000) { + } else if (ts.tv_nsec < 999999999L) { ts.tv_nsec++; } else { ts.tv_sec++;