if (conn->conn_state != LDAP_CONN_STATE_DISCONNECTED)
return 0;
- if (debug) {
- if (gettimeofday(&start, NULL) < 0)
- i_zero(&start);
- }
+ if (debug)
+ i_gettimeofday(&start);
i_assert(conn->pending_count == 0);
if (conn->delayed_connect) {
return -1;
if (debug) {
- if (gettimeofday(&end, NULL) == 0) {
- int msecs = timeval_diff_msecs(&end, &start);
- i_debug("LDAP initialization took %d msecs", msecs);
- }
+ i_gettimeofday(&end);
+ int msecs = timeval_diff_msecs(&end, &start);
+ i_debug("LDAP initialization took %d msecs", msecs);
}
db_ldap_get_fd(conn);
struct timeval end_tv;
unsigned int msecs, percentage;
- if (gettimeofday(&end_tv, NULL) < 0)
- return;
+ i_gettimeofday(&end_tv);
msecs = timeval_diff_msecs(&end_tv, start_tv);
if (msecs >= PASSWD_SLOW_WARN_MSECS) {
e_debug(authdb_event(auth_request), "lookup");
- if (gettimeofday(&start_tv, NULL) < 0)
- start_tv.tv_sec = 0;
+ i_gettimeofday(&start_tv);
ret = i_getpwnam(auth_request->user, &pw);
if (start_tv.tv_sec != 0)
passwd_check_warnings(auth_request, module, &start_tv);
static void wait_for_signal(const char *signal_file)
{
struct timeval start, now;
- if (gettimeofday(&start, NULL) < 0) {
- kill_stats_child();
- i_fatal("gettimeofday() failed %m");
- }
+ i_gettimeofday(&start);
while (access(signal_file, F_OK) < 0) {
i_sleep_msecs(10);
- if (gettimeofday(&now, NULL) < 0) {
- kill_stats_child();
- i_fatal("gettimeofday() failed %m");
- }
+ i_gettimeofday(&now);
if (timeval_diff_usecs(&now, &start) > 10000000) {
kill_stats_child();
i_fatal("wait_for_signal has timed out");