From nobody Fri May 31 14:47:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VrQtr4Lr0z5N1WD; Fri, 31 May 2024 14:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VrQtr3cf0z519J; Fri, 31 May 2024 14:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717166820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eng+4ELDtXAmJ7PGNWWliOWGAhPnhQ2l8F7KldVbw+0=; b=hBM01aNKxoQ5nKjxPjJncJbfaCl6u7Q8OnsSPFGcEgpuzHJoGULPvP9LregF+LFqp/bnJ4 3jK5tWrw+b/dTtUlze2pDG2hrUVgy7kcengLEi6aJdycjtJO+Ucb4fMWpScGiozw3Rs6DF HuTYSAWdPIMQ/TLJbAK1hmnjDk5P+5vkL96/Q8hsR4vbrR82K9XnLgnMpRAk8ytM1yXdhJ nEbtt+X2JyA8vKul0F4ZX1bVQjeeCIGLU6g7qZx3u8ubGFvgAWSHHaoHzQhpjweMniNGt3 z1ZaWeJIO1iiIY5HYVsRElGSdRVG2MNeRJhL6iJs9sLDrEHePLDrHn3vKzT1iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717166820; a=rsa-sha256; cv=none; b=ZJRfqUm3cJbwBoOa4p3oxpRwd7XLXOrDFCMkBS67GYGm7XfvSpNE0u4cLNgijMctc84VBb xY59yXuXMhuNNVb28sXCopDtcaQLgQvdlrV0Vwn4dV9oZd/F7nQwXDtRFxf21VpFSIJNsJ haYe+KPZCAHa30SRsVczu1Lh5m9qgw72ijHxznVoCIxnh1qAhEt5c50bHpUwU93a1dfatS gRnjeDn0LAvPUZgzQH1PsrRAkAb3AvaF+CRvx1/PlTvRgRmxsLOEmEvcRICeX5WK5kllJZ l/Bq2y9OrnpoYnL1dUOAkpLiANY3G1tRxUoeJoY83Qpq5sq+tyLGdY9q+vkHig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717166820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eng+4ELDtXAmJ7PGNWWliOWGAhPnhQ2l8F7KldVbw+0=; b=FZExmxrNbDaNPTK8w2X3NsAqe1YI2seWAQ0VCkBcFoboguFz79T9KiZTSKgb0Jmf/SAzai OxJys8AU6oqN1mjl9qcvtTmX1kxruT4OMtbZVgcabYM/5NFnaZWFTR62PVtEE+v0jghdGc y8SeHyIdRFI2Re9pUerIR9Wag6wz8Tqmz7E75khEXvcZ4dRyJFGZXIK1L3XsYCd72CytVT lEdjQZaCUHQsVlFpaxBntpSH4aapFFldLxjZ1z7WDXIfI75zYCBbjb/WUnMYInJVssTCRr KHlwNZEdEuzbJ2MHLgDr0vFldTzAEZFW4b9ZzKSAdOFtRyXlB/8P9lwj11jYvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VrQtr3CWjzSXd; Fri, 31 May 2024 14:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44VEl0B6078154; Fri, 31 May 2024 14:47:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44VEl06w078151; Fri, 31 May 2024 14:47:00 GMT (envelope-from git) Date: Fri, 31 May 2024 14:47:00 GMT Message-Id: <202405311447.44VEl06w078151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 676041c41ba5 - main - WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 676041c41ba587285bb934aa2fca290ea7208038 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=676041c41ba587285bb934aa2fca290ea7208038 commit 676041c41ba587285bb934aa2fca290ea7208038 Author: Warner Losh AuthorDate: 2024-05-31 14:44:55 +0000 Commit: Warner Losh CommitDate: 2024-05-31 14:44:55 +0000 WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same Historically, these have been differnet values, and only one was defined or they were defined as different values. Now that they are about to be the same value, add #ifdef to cope. Sponsored by: Netflix Reviewed by: olce, val_packett.cool, adrian Differential Revision: https://reviews.freebsd.org/D45418 --- contrib/wpa/src/utils/os_unix.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/contrib/wpa/src/utils/os_unix.c b/contrib/wpa/src/utils/os_unix.c index 315c973f3228..a856179fb3b1 100644 --- a/contrib/wpa/src/utils/os_unix.c +++ b/contrib/wpa/src/utils/os_unix.c @@ -72,7 +72,6 @@ int os_get_time(struct os_time *t) return res; } - int os_get_reltime(struct os_reltime *t) { #ifndef __MACH__ @@ -97,15 +96,21 @@ int os_get_reltime(struct os_reltime *t) return 0; } switch (clock_id) { -#ifdef CLOCK_BOOTTIME +#if defined(CLOCK_BOOTTIME) case CLOCK_BOOTTIME: clock_id = CLOCK_MONOTONIC; break; #endif -#ifdef CLOCK_MONOTONIC +#if defined(CLOCK_MONOTONIC) +/* + * FreeBSD has both BOOTTIME and MONOTONIC defined to the same value, since they + * mean the same thing. FreeBSD 14.1 and ealier don't, so need this case. + */ +#if !(defined(CLOCK_BOOTTIME) && CLOCK_BOOTTIME == CLOCK_MONOTONIC) case CLOCK_MONOTONIC: clock_id = CLOCK_REALTIME; break; +#endif #endif case CLOCK_REALTIME: return -1;