From 4caf7faa74c184f92c99a15d40c51af48a6e75ce Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Fri, 18 May 2007 14:45:56 +0000 Subject: [PATCH] Warning cleanup (avoid cast double return val -> integer, gcc gets suspicious) --- servers/slapd/back-monitor/time.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-monitor/time.c b/servers/slapd/back-monitor/time.c index 0b7653a50e..f3450d8315 100644 --- a/servers/slapd/back-monitor/time.c +++ b/servers/slapd/back-monitor/time.c @@ -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 ); -- 2.39.5