From: Eric Leblond Date: Tue, 26 Apr 2016 17:55:51 +0000 (+0200) Subject: af-packet: use time() instead of GetTime() X-Git-Tag: suricata-3.1RC1~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49612128f3b24b4224d58842cff1540fc9a42b08;p=thirdparty%2Fsuricata.git af-packet: use time() instead of GetTime() As we only use the second we don't need GetTime() which is slower and get us milliseconds. --- diff --git a/src/source-af-packet.c b/src/source-af-packet.c index 0581f00e72..8a429b78f1 100644 --- a/src/source-af-packet.c +++ b/src/source-af-packet.c @@ -1300,7 +1300,7 @@ TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot) int r; TmSlot *s = (TmSlot *)slot; time_t last_dump = 0; - struct timeval current_time; + time_t current_time; int (*AFPReadFunc) (AFPThreadVars *); uint64_t discarded_pkts = 0; @@ -1419,10 +1419,10 @@ TmEcode ReceiveAFPLoop(ThreadVars *tv, void *data, void *slot) switch (r) { case AFP_READ_OK: /* Trigger one dump of stats every second */ - TimeGet(¤t_time); - if (current_time.tv_sec != last_dump) { + current_time = time(NULL); + if (current_time != last_dump) { AFPDumpCounters(ptv); - last_dump = current_time.tv_sec; + last_dump = current_time; } break; case AFP_READ_FAILURE: