]> git.sur5r.net Git - openldap/commitdiff
avoid system call when not needed (ITS#5441)
authorPierangelo Masarati <ando@openldap.org>
Sat, 29 Mar 2008 12:11:44 +0000 (12:11 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 29 Mar 2008 12:11:44 +0000 (12:11 +0000)
servers/slapd/overlays/auditlog.c

index 55aabd40af8909c858b6c49349154c1e946a0d83..7d7b82a8f6432214a397534df03b70579961b118 100644 (file)
@@ -74,7 +74,7 @@ static int auditlog_response(Operation *op, SlapReply *rs) {
        Modifications *m;
        struct berval *b, *who = NULL;
        char *what, *suffix;
-       long stamp = slap_get_time();
+       time_t stamp;
        int i;
 
        if ( rs->sr_err != LDAP_SUCCESS ) return SLAP_CB_CONTINUE;
@@ -125,6 +125,7 @@ static int auditlog_response(Operation *op, SlapReply *rs) {
                return SLAP_CB_CONTINUE;
        }
 
+       stamp = slap_get_time();
        fprintf(f, "# %s %ld %s%s%s\n",
                what, stamp, suffix, who ? " " : "", who ? who->bv_val : "");