]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/csn.c
Fix typo in dec to bin conversion
[openldap] / libraries / liblutil / csn.c
index 647eabe4ec9ee03d28fee8793872b549f55bda5c..4eb29bcce2aa14d85ebb41c4a987956914e2ed64 100644 (file)
 
 #include <lutil.h>
 
+/* Must be mutex-protected, because lutil_gettime needs mutex protection */
 size_t
 lutil_csnstr(char *buf, size_t len, unsigned int replica, unsigned int mod)
 {
        struct lutil_tm tm;
-       static unsigned int csnop;
-       static int prev_sec, prev_usec;
-
-       unsigned int op;
        int n;
 
        lutil_gettime( &tm );
 
-       if ( tm.tm_usec != prev_usec || tm.tm_sec != prev_sec ) {
-               prev_sec = tm.tm_sec;
-               prev_usec = tm.tm_usec;
-               csnop = 0;
-       }
-       op = csnop++;
-
        n = snprintf( buf, len,
                "%4d%02d%02d%02d%02d%02d.%06dZ#%06x#%03x#%06x",
            tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour,
-           tm.tm_min, tm.tm_sec, tm.tm_usec, op, replica, mod );
+           tm.tm_min, tm.tm_sec, tm.tm_usec, tm.tm_usub, replica, mod );
 
        if( n < 0 ) return 0;
        return ( (size_t) n < len ) ? n : 0;