]> git.sur5r.net Git - openldap/commitdiff
Fix pointer incompatibility issue on some platforms
authorKurt Zeilenga <kurt@OpenLDAP.org>
Fri, 10 Oct 2014 18:56:31 +0000 (11:56 -0700)
committerKurt Zeilenga <kurt.zeilenga@isode.com>
Fri, 10 Oct 2014 18:56:31 +0000 (11:56 -0700)
Don't assume tv_sec is a time_t.

libraries/libldap/result.c

index 71b6f0e9d0b315276c5fdfea1f0184d0a6dfc496..b366ce8e0108888fcf47183eb785ff808d1470da 100644 (file)
@@ -273,7 +273,7 @@ wait4msg(
 #ifdef HAVE_GETTIMEOFDAY
                gettimeofday( &start_time_tv, NULL );
 #else /* ! HAVE_GETTIMEOFDAY */
-               time( &start_time_tv.tv_sec );
+               start_time_tv.tv_sec = time( NULL );
                start_time_tv.tv_usec = 0;
 #endif /* ! HAVE_GETTIMEOFDAY */
        }
@@ -387,7 +387,7 @@ wait4msg(
 #ifdef HAVE_GETTIMEOFDAY
                        gettimeofday( &curr_time_tv, NULL );
 #else /* ! HAVE_GETTIMEOFDAY */
-                       time( &curr_time_tv.tv_sec );
+                       start_time_tv.tv_sec = time( NULL );
                        curr_time_tv.tv_usec = 0;
 #endif /* ! HAVE_GETTIMEOFDAY */