diff --git a/php_phongo.c b/php_phongo.c index 514658a02..a99e6833f 100644 --- a/php_phongo.c +++ b/php_phongo.c @@ -303,7 +303,7 @@ static void php_phongo_log(mongoc_log_level_t log_level, const char* log_domain, (void) user_data; - gettimeofday(&tv, NULL); + bson_gettimeofday(&tv); t = tv.tv_sec; tu = tv.tv_usec; @@ -1326,7 +1326,7 @@ void php_phongo_write_concern_to_zval(zval* retval, const mongoc_write_concern_t if (wtimeout != 0) { #if SIZEOF_ZEND_LONG == 4 if (wtimeout > INT32_MAX || wtimeout < INT32_MIN) { - ADD_ASSOC_INT64_AS_STRING(&retval, "wtimeout", wtimeout); + ADD_ASSOC_INT64_AS_STRING(retval, "wtimeout", wtimeout); } else { ADD_ASSOC_LONG_EX(retval, "wtimeout", wtimeout); } diff --git a/src/BSON/UTCDateTime.c b/src/BSON/UTCDateTime.c index 8bf87c1b7..cd03bb0fc 100644 --- a/src/BSON/UTCDateTime.c +++ b/src/BSON/UTCDateTime.c @@ -82,7 +82,7 @@ static bool php_phongo_utcdatetime_init_from_current_time(php_phongo_utcdatetime int64_t sec, usec; struct timeval cur_time; - gettimeofday(&cur_time, NULL); + bson_gettimeofday(&cur_time); sec = cur_time.tv_sec; usec = cur_time.tv_usec;