From nobody Wed Dec 13 20:06:32 2023 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 4Sr6204Tkjz54Fh6; Wed, 13 Dec 2023 20:06:32 +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 4Sr6203jt8z4Z7L; Wed, 13 Dec 2023 20:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497992; 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=t0tqAXG8aq/G+eFf9Z1Mowh/xVyYq0B1syFcWOCyTio=; b=EE01HmxmgAFEITEVhe2yFglN4k2ufYT+RMdpTh0G1cgijO8EfLl2AnbfH9CPjvssvzWXVR iO3VBIgJmDmX+cvdB7gx7rtf8gA1j054809DxbDjXR1WT+19Xe9QRzl1T0wU69GUbHRXte Z5mKnbHDXriWgIJSIj9ETo8wCNVZuFFYvIy7bMHyVu+wZzPDXA6r2R+mfeU9FD4KeTO8KL OEsu+AG7lDCamScp1gq3XZMnw2WnqH/8UViRkTfaj+iTlHBvINK870x147fxiqVVw0gbTW HO4pTGLi0z9z/pvtue5g4q8a8EGKugDVTgh+azcPQTuz3m/ID/pcxQc0Y3AoxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497992; a=rsa-sha256; cv=none; b=Z9mJYX+R4LTdGdub15xqLoVCRAPLxrd97qu6X8pfMIq9Z1tdhnoPoA1sZavkNVo6ZrTsQF oATAu7Gd+s/Gi5P05NKs25Ul/gkHdSLc5YXKCaRYyVeqrzwO6oUprUjZCNrEg2is9D4/sD iy4M31OJe5uvV3JIoQEXGU5dOWTlC0QW4uZnZP/89sh8BJRt88kkWyR+UeubXbi9j1ukAp 4p/jAIdvp9r+mpK2ZRFlDBqECSFQOCUnEQM4cTcwcAF7RymMyFIEIlEaYz/9yWps6rQ4PK bBArYhC0LqHVB4jrGO7GOb8lWBGzdRz86MO0tq+AySMnicZE1f9zvk6dHR6CPw== 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=1702497992; 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=t0tqAXG8aq/G+eFf9Z1Mowh/xVyYq0B1syFcWOCyTio=; b=OpeAwNCFuAtm4zycSOql3yU/8gCMeYKV0tcMIUosupc728JHlzSCHBgah1Pol6srJd9n3s U2WW3BSMCpdHYT2lh/BiECKG/l2S94tMEcaAf2KShUWebH0zyRisxfAtbjO5VAAXU8l9T1 KEzM3TqMYvzQwwdEH+/Vgdl2zUm5AdcsS3OMTr+9MVWnuwyjKNDaFRul8qJFyXtdbb6gKE Hv91y4DwriO52ZPZIjLsWkfyPkIis/AiLMmhQTBfRmqjx4XCwlTkSuMEgZqR7oI8fE5AE/ Wpa5klM+h1eCjiEuhzoPGVymyOx9Heb6QfckB0KTqXQGi4eVhcv1WW6RPtxHrg== 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 4Sr6202qVZz1Bxf; Wed, 13 Dec 2023 20:06:32 +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 3BDK6WCT087504; Wed, 13 Dec 2023 20:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6W5l087501; Wed, 13 Dec 2023 20:06:32 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:32 GMT Message-Id: <202312132006.3BDK6W5l087501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 3109a31bf21b - stable/13 - tail: Retry kevent if the system call was interrupted 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3109a31bf21b50aded5f27900e7a58490daeac48 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3109a31bf21b50aded5f27900e7a58490daeac48 commit 3109a31bf21b50aded5f27900e7a58490daeac48 Author: Warner Losh AuthorDate: 2023-02-19 03:04:29 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:38 +0000 tail: Retry kevent if the system call was interrupted kevent returns EINTR when I suspend / resume. This causes tail -f and tail -F to exit with interrupt system call. Ignore this error and try kevent again. Sponsored by: Netflix (cherry picked from commit ef6f20ce47613db7cc615b45f4b6fa1eb99ae0ba) --- usr.bin/tail/forward.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index f991b2517c48..e2a3eb77aade 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -408,10 +408,16 @@ follow(file_info_t *files, enum STYLE style, off_t off) /* * In the -F case we set a timeout to ensure that * we re-stat the file at least once every second. + * If we've recieved EINTR, ignore it. Both reasons + * for its generation are transient. */ - n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); - if (n < 0) - err(1, "kevent"); + do { + n = kevent(kq, NULL, 0, ev, 1, Fflag ? &ts : NULL); + if (n < 0 && errno == EINTR) + continue; + if (n < 0) + err(1, "kevent"); + } while (n < 0); if (n == 0) { /* timeout */ break;