mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-27 04:04:53 +02:00
timeval_func: move all timeval manipulation to separate file
There are several definitions of the same functions manipulating timeval structures. Let's move them to separate file and arrange the code preperly. Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
This commit is contained in:
+1
-16
@@ -51,6 +51,7 @@
|
||||
#include "testcode/testpkts.h"
|
||||
#include "testcode/fake_event.h"
|
||||
#include "sldns/str2wire.h"
|
||||
#include "util/timeval_func.h"
|
||||
|
||||
/** max length of lines in file */
|
||||
#define MAX_LINE_LEN 10240
|
||||
@@ -66,22 +67,6 @@
|
||||
static char* macro_expand(rbtree_type* store,
|
||||
struct replay_runtime* runtime, char** text);
|
||||
|
||||
/** compare of time values */
|
||||
static int
|
||||
timeval_smaller(const struct timeval* x, const struct timeval* y)
|
||||
{
|
||||
#ifndef S_SPLINT_S
|
||||
if(x->tv_sec < y->tv_sec)
|
||||
return 1;
|
||||
else if(x->tv_sec == y->tv_sec) {
|
||||
if(x->tv_usec <= y->tv_usec)
|
||||
return 1;
|
||||
else return 0;
|
||||
}
|
||||
else return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** parse keyword in string.
|
||||
* @param line: if found, the line is advanced to after the keyword.
|
||||
* @param keyword: string.
|
||||
|
||||
Reference in New Issue
Block a user