]> git.sur5r.net Git - openldap/commitdiff
Warning cleanup (avoid cast double return val -> integer, gcc gets suspicious)
authorHallvard Furuseth <hallvard@openldap.org>
Fri, 18 May 2007 14:45:56 +0000 (14:45 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Fri, 18 May 2007 14:45:56 +0000 (14:45 +0000)
servers/slapd/back-monitor/time.c

index 0b7653a50edbbcdce89025807bd478b8a0d25e12..f3450d8315dc4ec4e28e90f829cb355101a0e300 100644 (file)
@@ -242,6 +242,7 @@ monitor_subsys_time_update(
 
        } else if ( dn_match( &rdn, &bv_uptime ) ) {
                Attribute       *a;
+               double          diff;
                char            buf[ BACKMONITOR_BUFSIZE ];
                struct berval   bv;
 
@@ -250,8 +251,9 @@ monitor_subsys_time_update(
                        return rs->sr_err = LDAP_OTHER;
                }
 
+               diff = difftime( slap_get_time(), starttime );
                bv.bv_len = snprintf( buf, sizeof( buf ), "%lu",
-                       (unsigned long)difftime( slap_get_time(), starttime ) );
+                       (unsigned long) diff );
                bv.bv_val = buf;
 
                ber_bvreplace( &a->a_vals[ 0 ], &bv );