From owner-svn-src-stable@freebsd.org Mon Jan 9 05:50:54 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FC9CA56A2; Mon, 9 Jan 2017 05:50:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D91861FE8; Mon, 9 Jan 2017 05:50:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v095or41099962; Mon, 9 Jan 2017 05:50:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v095orle099958; Mon, 9 Jan 2017 05:50:53 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701090550.v095orle099958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Jan 2017 05:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311749 - stable/11/libexec/talkd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 05:50:54 -0000 Author: delphij Date: Mon Jan 9 05:50:52 2017 New Revision: 311749 URL: https://svnweb.freebsd.org/changeset/base/311749 Log: MFC r310609: Don't use high precision clock for expiration as only second portion is used. Modified: stable/11/libexec/talkd/table.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/talkd/table.c ============================================================================== --- stable/11/libexec/talkd/table.c Mon Jan 9 05:46:41 2017 (r311748) +++ stable/11/libexec/talkd/table.c Mon Jan 9 05:50:52 2017 (r311749) @@ -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_RESPO 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 */