diff options
| author | Xin LI <delphij@FreeBSD.org> | 2016-12-26 17:23:09 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2016-12-26 17:23:09 +0000 |
| commit | 62b0ff4e66c9c6f08d7f588efb1850377c0a2234 (patch) | |
| tree | d20045150a8e7ab58ad80e6ba3571d0b6186bd13 /libexec/talkd | |
| parent | 9a0ebab4d49bc825d36a444d5bb4e04bdfcf4476 (diff) | |
Notes
Diffstat (limited to 'libexec/talkd')
| -rw-r--r-- | libexec/talkd/table.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libexec/talkd/table.c b/libexec/talkd/table.c index 59ef6ef93c0e..30200c45e997 100644 --- a/libexec/talkd/table.c +++ b/libexec/talkd/table.c @@ -60,7 +60,7 @@ static const char rcsid[] = #define NIL ((TABLE_ENTRY *)0) -static struct timeval tp; +static struct timespec ts; typedef struct table_entry TABLE_ENTRY; @@ -85,8 +85,8 @@ find_match(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; if (debug) print_request("find_match", request); for (ptr = table; ptr != NIL; ptr = next) { @@ -119,8 +119,8 @@ find_request(CTL_MSG *request) TABLE_ENTRY *ptr, *next; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; /* * See if this is a repeated message, and check for * out of date entries in the table while we are it. @@ -157,8 +157,8 @@ insert_table(CTL_MSG *request, CTL_RESPONSE *response) TABLE_ENTRY *ptr; time_t current_time; - gettimeofday(&tp, NULL); - current_time = tp.tv_sec; + clock_gettime(CLOCK_MONOTONIC_FAST, &ts); + current_time = ts.tv_sec; request->id_num = new_id(); response->id_num = htonl(request->id_num); /* insert a new entry into the top of the list */ |
