From nobody Wed Apr 13 06:04:33 2022 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 B7E4D1AF7098; Wed, 13 Apr 2022 06:04:33 +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 4KdX9Y4f9Cz3qtp; Wed, 13 Apr 2022 06:04:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649829873; 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=+8AkLVjNOGfnjlqpHah1RVZMQ9ERK63ewRhHoDv+bCc=; b=uCKmO8uFAdlM1vrsKCdmnM68anId+/Fq4QYgYr1qsj1VRVpAjhLEzLWVZhFjCQSfQAmnSZ IKvZLaWAr04xy2l1xF/BM9nLs2de3LwlyPT4quqMJRCe3DgYxsQVBAbH4Yt8S/zNUKpnDj 47P3tpj8a+P9yTMFZANglI10hnvkR17zrJN6kZNiXE2M36AFwmfeTJjKfjnUDs/MMHpEaa n8pT19F6LdtagTp8jti7CLbr46tPzg6DFvEkzJTjxZqi2YJCk23MDVIZsB6kccl/2z2rmQ 1LJbB0L4DNUulDlhmSF9U9lglTYKGpCsBzovw3r2HH9JThlj2QU6W+CLlyfkQQ== 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 7FA3826598; Wed, 13 Apr 2022 06:04:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23D64XLJ096972; Wed, 13 Apr 2022 06:04:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23D64X9j096971; Wed, 13 Apr 2022 06:04:33 GMT (envelope-from git) Date: Wed, 13 Apr 2022 06:04:33 GMT Message-Id: <202204130604.23D64X9j096971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando Apestegu=C3=ADa?= Subject: git: e07b0c12ba64 - main - [patch][doc] Fix EXAMPLE in kqueue(2) 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: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e07b0c12ba6435421ceb7dd028402d5cbfc1f1dd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649829873; 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=+8AkLVjNOGfnjlqpHah1RVZMQ9ERK63ewRhHoDv+bCc=; b=BnJexEbhfyyipB4orcd1nXr6U/D3wfY3cg5eZrMk7ychR2MSfK9UbsUPmULuEDbWSYwKr/ lw2Smp0Atxl2/GiphLjd4636vG1mgb1VmPXrMiHnts3nHEE2wuMHpJObRvhV6yiynomSIe Jv2E+ups6s3uwBS482bXovMlcf9HtpSXt+W2/s4v3UudPK+9EP8KP57yk2G98zd0EwnLEs 7qBqmGXnKMRHu4Y4RkJUMhIps8aNQb63YzOUPKqxXe9Xs1r5MfHGM0dv+AiMqThN8oo9VX 94hkCekSy7/OVazA36PedITE2E+1ZJAH4pymwrYAOTJY78NqBd9J9FTrgfYSKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649829873; a=rsa-sha256; cv=none; b=PvpMvngF3suKaQjCkWpVuZaBnE0aYGF/lpV22s0nUdluHfcPNcI6fiY9PTPDWyhdxYgv15 qQ1692vEPiTIHMXnTAx1wP2bCVOuodmBlU+46Np1l3vkxVFXaCFB+sLX6SY4yuGJU89+6/ Js5GzKpnlCkDqfQgH7GbwczVuhz795mFSXSAhQMN1Ta/nrBVytlGztDzFzuxMZ0yVQ12/0 KSIPVY7e8kdjjLfOfHEcvM1mTTXz3aIDkneAXjWs38auT76uRG1XJ8flJX2T1xFxXKJPSA JnrWHlSCxEjBHuXxon8vGh379KG0CuMc+hg4qEjDbgXwdBM362KGP2pR5CeVUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e07b0c12ba6435421ceb7dd028402d5cbfc1f1dd commit e07b0c12ba6435421ceb7dd028402d5cbfc1f1dd Author: Fernando ApesteguĂ­a AuthorDate: 2022-04-11 18:40:28 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2022-04-13 06:01:58 +0000 [patch][doc] Fix EXAMPLE in kqueue(2) The error control was not properly implemented. "changelist" is const, hence event.flags is never changed by the syscall. PR: 196844 Reported by: eugen@ Reviewed by: PauAmma Approved by: eugen@ Fixes: 8c231786f01b9f8614e2fe5b47196db1caa7a772 --- lib/libc/sys/kqueue.2 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 8ba1779c5551..b4531b6cd02b 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2022 +.Dd April 13, 2022 .Dt KQUEUE 2 .Os .Sh NAME @@ -742,8 +742,6 @@ main(int argc, char **argv) ret = kevent(kq, &event, 1, NULL, 0, NULL); if (ret == -1) err(EXIT_FAILURE, "kevent register"); - if (event.flags & EV_ERROR) - errx(EXIT_FAILURE, "Event error: %s", strerror(event.data)); for (;;) { /* Sleep until something happens. */ @@ -751,8 +749,12 @@ main(int argc, char **argv) if (ret == -1) { err(EXIT_FAILURE, "kevent wait"); } else if (ret > 0) { - printf("Something was written in '%s'\en", argv[1]); - } + if (tevent.flags & EV_ERROR) + errx(EXIT_FAILURE, "Event error: %s", strerror(event.data)); + else + printf("Something was written in '%s'\en", argv[1]); +} + } } .Ed