From patchwork Thu Nov 7 09:00:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1191003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106740-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="i44hlIwz"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477y890b4Yz9sNx for ; Thu, 7 Nov 2019 20:02:00 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=g1bKMJb0tqo793Dnkkn+UuRUYw/gbo6 8GqRvOLanwlrnQDDphRISWtVlRXuMLJutlJWWdHk/zd/oowMeSG0IKUX5dLSx6gp HxpB9zsGlGPq9KLgGkVDXcXNfN65ce8p3bs/0Ghh1XMhKQAgrRxC0mABC9SGFvJS PsAUi/x1wyvY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=ttiwCDpw1SQXS6OI7L6vffSTAEo=; b=i44hl Iwz6q1zWMZ6SY2fHgqXWesiwWC+oTlTRhiIYjakXClPUqmp/THjKAme9ELA3dbib SzjpSGJtw/82P5HRm5B0eXSarVXTPHrF5zODYFM+/8G2df2WZ4vGCPeTYLYTJInQ mydQW6v5nlSdZwaspboRpIVvC/KJ/+h7SZZMsY= Received: (qmail 43434 invoked by alias); 7 Nov 2019 09:01:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 42618 invoked by uid 89); 7 Nov 2019 09:00:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=1928 X-HELO: mx1.osci.io X-Gerrit-PatchSet: 2 Date: Thu, 7 Nov 2019 04:00:11 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Florian Weimer , Adhemerval Zanella , libc-alpha@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [pushed] hurd: Use __clock_gettime in _hurd_select X-Gerrit-Change-Id: Ia6da4045157a5bbccc67d79e881d7592e6f8a890 X-Gerrit-Change-Number: 506 X-Gerrit-ChangeURL: X-Gerrit-Commit: a673c07af3bcfa24432c3fd8a1dea12f931ee903 In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, adhemerval.zanella@linaro.org, fweimer@redhat.com, libc-alpha@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Message-Id: <20191107090012.602332816D@gnutoolchain-gerrit.osci.io> The original change was created by Florian Weimer. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/506 ...................................................................... hurd: Use __clock_gettime in _hurd_select The __gettimeofday references caused check-localplt failures after commit 5e46749c64d5. Fixes: 5e46749c64d51f50f8511ed99c1266d7c13e182b Reviewed-by: Samuel Thibault Change-Id: Ia6da4045157a5bbccc67d79e881d7592e6f8a890 --- M hurd/hurdselect.c 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c index 79cd20b..6a174bc 100644 --- a/hurd/hurdselect.c +++ b/hurd/hurdselect.c @@ -88,7 +88,7 @@ reply_msgid = IO_SELECT_REPLY_MSGID; else { - struct timeval now; + struct timespec now; if (timeout->tv_sec < 0 || ! valid_nanoseconds (timeout->tv_nsec)) { @@ -96,12 +96,12 @@ return -1; } - err = __gettimeofday(&now, NULL); + err = __clock_gettime (CLOCK_REALTIME, &now); if (err) return -1; ts.tv_sec = now.tv_sec + timeout->tv_sec; - ts.tv_nsec = now.tv_usec * 1000 + timeout->tv_nsec; + ts.tv_nsec = now.tv_nsec + timeout->tv_nsec; if (ts.tv_nsec >= 1000000000) { @@ -175,8 +175,7 @@ if (error) { /* Set timeout to 0. */ - struct timeval now; - err = __gettimeofday(&now, NULL); + err = __clock_gettime (CLOCK_REALTIME, &ts); if (err) { /* Really bad luck. */ @@ -192,8 +191,6 @@ errno = err; return -1; } - ts.tv_sec = now.tv_sec; - ts.tv_nsec = now.tv_usec * 1000; reply_msgid = IO_SELECT_TIMEOUT_REPLY_MSGID; }