From nobody Thu Jan 20 09:30:35 2022 X-Original-To: dev-commits-ports-main@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 A02A11976727; Thu, 20 Jan 2022 09:30:35 +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 4Jfcgb3Dwfz3nG2; Thu, 20 Jan 2022 09:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642671035; 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=AvVLKAE0RhK5Fn1MmEt43fc7um6zx1yzNYwgcUPyD/4=; b=w3DtZ++C0QBaQalarDdsz2IkvPBGmAeO/51dqZHP0w1k83olg7tITYd9hJ4yRK+GfF3AZT ZaYGx2ddK0KjUZ+mXFEA7VjGJ6NH9xQO6jfXEzQ3y8LluDE/gm3Nox8TDba4huZrrMyvLE JE39fR1esW0pNq6Iit1pgi5BP45BsLiszBZaPJBNTwuMpZGhh4DTwq5+g4WzrPKVX67vQ9 xcPKnGiJ+MF0agrt9bi/yfZc57PKAAkZoN+5vfrM9gJk00DULs/jHopTE4uPMUQk+S9Vcs fdAizQyY3QnuWKoDSGrgZFH4kS9UQPAxDih6L3OSpI5QdRdibN1W6cF3Iz/Kxw== 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 48C3A2586B; Thu, 20 Jan 2022 09:30:35 +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 20K9UZ1c045417; Thu, 20 Jan 2022 09:30:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20K9UZlt045416; Thu, 20 Jan 2022 09:30:35 GMT (envelope-from git) Date: Thu, 20 Jan 2022 09:30:35 GMT Message-Id: <202201200930.20K9UZlt045416@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gleb Popov Subject: git: 2c0c288cb092 - main - devel/libfixposix: Import newer upstream fix List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c0c288cb09231ccdfd7ec6f3616121c923d51ad Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642671035; 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=AvVLKAE0RhK5Fn1MmEt43fc7um6zx1yzNYwgcUPyD/4=; b=HV6yZJW3vksnHFeNl8F3mGJLgyGveBzxuoNWN6lLUTSLCGWMPy+bPm1llqXk1QYZSMD4B/ WoE0hP5hnVuAj69UBiy48DfSRxk5BtY9MsMlGHAN1z3yTAWLokmNOoqiZoeMm5Q89WUG6Z XHun8fkmtlRrfpl6icEAqjBjY8oetB+H5A8gSlN/hNglINrchufK/K12Jv3IkPszsANMic WwRqCnlDvfVbg479KipD6maqctbPr0ZiEtzC5Qacv5Nu9h9qWT1K8jkzEaaUbB0sA3PduM aCcb7CT9pDoMTbA/l86Em3evHtKohe64rpw1wxQuYIHE+GoiO6i0/mjWQ/Uj8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642671035; a=rsa-sha256; cv=none; b=c8oFW3Uon7806xFIajIBe2T4+KmuhQSMM4AhQGR3uFJZiwCeGzYZZdzT8EWb3ISV492bLU yTumihiLlFJu+T/5hFwepkmbjhmeRvZ+i2yu1Q0LFCAs2CDGk9KAOEq5Pao+kqpbHXOs3v VXP4r+iShRACSnBmePkBPdwvebftX5HDYkPb+6R8NFpbjnG3qEwb3/lC2RJFl2JJjGQ0QN 6ZZdtDK+AZrN4dNU6skfx/lF5peHXtY1+RtdPh9xyiSjKgPoSXB5dQtM+7R0YJJYPIhhtL 2+W/A2wovRJ2vCJFEJGmXKtvq9y59qs0QHmVeUB17POq+V48PSBKi5gAdvjDHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=2c0c288cb09231ccdfd7ec6f3616121c923d51ad commit 2c0c288cb09231ccdfd7ec6f3616121c923d51ad Author: Filipe da Silva Santos AuthorDate: 2022-01-20 09:27:28 +0000 Commit: Gleb Popov CommitDate: 2022-01-20 09:29:37 +0000 devel/libfixposix: Import newer upstream fix Last fix was not complete, since it didn't take `EAGAIN' semantic differences between Linux and FreeBSD in consideration. Reported by: Vasily Postnicov Obtained from: https://github.com/sionescu/libfixposix/commit/cc50634551849cc667edd5b5b29f6f54ae2f9bc4 Differential Revision: https://reviews.freebsd.org/D33931 --- devel/libfixposix/Makefile | 2 +- devel/libfixposix/files/patch-src_lib_sendfile.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/devel/libfixposix/Makefile b/devel/libfixposix/Makefile index 0bf0e398cafc..1cebb9f7f059 100644 --- a/devel/libfixposix/Makefile +++ b/devel/libfixposix/Makefile @@ -1,7 +1,7 @@ PORTNAME= libfixposix DISTVERSIONPREFIX= v DISTVERSION= 0.4.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MAINTAINER= ports@shiori.com.br diff --git a/devel/libfixposix/files/patch-src_lib_sendfile.c b/devel/libfixposix/files/patch-src_lib_sendfile.c index c69cc84fa1ed..4c80ea88e027 100644 --- a/devel/libfixposix/files/patch-src_lib_sendfile.c +++ b/devel/libfixposix/files/patch-src_lib_sendfile.c @@ -4,7 +4,7 @@ mimicking Linux sendfile(2). Submited to upstream by Vasily Postnicov (shamaz.mazum@gmail.com), see https://github.com/sionescu/libfixposix/pull/18. ---- src/lib/sendfile.c.orig 2018-02-19 22:24:10 UTC +--- src/lib/sendfile.c.orig 2022-01-18 20:14:50 UTC +++ src/lib/sendfile.c @@ -38,6 +38,7 @@ int sendfile(int, int, off_t, off_t *, void *, int); #endif @@ -14,7 +14,7 @@ see https://github.com/sionescu/libfixposix/pull/18. DSO_PUBLIC ssize_t lfp_sendfile(int out_fd, int in_fd, off_t offset, size_t nbytes) -@@ -46,18 +47,21 @@ lfp_sendfile(int out_fd, int in_fd, off_t offset, size +@@ -46,18 +47,25 @@ lfp_sendfile(int out_fd, int in_fd, off_t offset, size # if defined(__linux__) off_t off = offset; return (ssize_t) sendfile(out_fd, in_fd, &off, nbytes); @@ -23,15 +23,19 @@ see https://github.com/sionescu/libfixposix/pull/18. -# elif defined(__DragonFly__) - return (ssize_t) sendfile(in_fd, out_fd, offset, nbytes, NULL, NULL, 0); +# elif defined(__FreeBSD__) || defined(__DragonFly__) -+ off_t sbytes; ++ off_t sbytes = 0; + int res = sendfile(in_fd, out_fd, offset, nbytes, NULL, &sbytes, 0); -+ if (res == 0) { return sbytes; } -+ return res; ++ if (res == 0 || (res < 0 && errno == EAGAIN && sbytes > 0)) { ++ return sbytes; ++ } ++ return -1; # elif defined(__APPLE__) off_t len = nbytes; - return (ssize_t) sendfile(in_fd, out_fd, offset, &len, NULL, 0); + int res = sendfile(in_fd, out_fd, offset, &len, NULL, 0); -+ if (res == 0) { return len; } ++ if (res == 0 || (res < 0 && errno == EAGAIN && len > 0)) { ++ return len; ++ } + return -1; # else # error "It appears that this OS has sendfile(), but LFP doesn't use it at the moment"