summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2016-12-26 17:10:41 +0000
committerXin LI <delphij@FreeBSD.org>2016-12-26 17:10:41 +0000
commit9a0ebab4d49bc825d36a444d5bb4e04bdfcf4476 (patch)
treee82043997aa11bf4a5ea739ce698d1f8bcfbf01b /libexec
parenta0a23564a31e5cf25bc898b2c339e39b4836a440 (diff)
downloadsrc-test2-9a0ebab4d49bc825d36a444d5bb4e04bdfcf4476.tar.gz
src-test2-9a0ebab4d49bc825d36a444d5bb4e04bdfcf4476.zip
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/talkd/table.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libexec/talkd/table.c b/libexec/talkd/table.c
index e98bfe30337c..59ef6ef93c0e 100644
--- a/libexec/talkd/table.c
+++ b/libexec/talkd/table.c
@@ -82,14 +82,15 @@ static TABLE_ENTRY *table = NIL;
CTL_MSG *
find_match(CTL_MSG *request)
{
- TABLE_ENTRY *ptr;
+ TABLE_ENTRY *ptr, *next;
time_t current_time;
gettimeofday(&tp, NULL);
current_time = tp.tv_sec;
if (debug)
print_request("find_match", request);
- for (ptr = table; ptr != NIL; ptr = ptr->next) {
+ for (ptr = table; ptr != NIL; ptr = next) {
+ next = ptr->next;
if ((ptr->time - current_time) > MAX_LIFE) {
/* the entry is too old */
if (debug)
@@ -115,7 +116,7 @@ find_match(CTL_MSG *request)
CTL_MSG *
find_request(CTL_MSG *request)
{
- TABLE_ENTRY *ptr;
+ TABLE_ENTRY *ptr, *next;
time_t current_time;
gettimeofday(&tp, NULL);
@@ -126,7 +127,8 @@ find_request(CTL_MSG *request)
*/
if (debug)
print_request("find_request", request);
- for (ptr = table; ptr != NIL; ptr = ptr->next) {
+ for (ptr = table; ptr != NIL; ptr = next) {
+ next = ptr->next;
if ((ptr->time - current_time) > MAX_LIFE) {
/* the entry is too old */
if (debug)