From nobody Fri Nov 24 16:06:02 2023 X-Original-To: dev-commits-ports-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 4ScKbH1lJfz529kl; Fri, 24 Nov 2023 16:06:03 +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 4ScKbH1FY4z3Lgb; Fri, 24 Nov 2023 16:06:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700841963; 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=X260RAJqiJpf6XJZLFb4aiqp20sSAZarwHLLOYGGTVU=; b=vtREJI9iiuf2g2TM2xukgxk/LUCeaJMwoYRmwyjSAQxz6W+5Z2WRf1F4mX3WfiaTAKaVsM GOmyGi20iJpAM/QL+H/2M7fnXsKustwwsiMC1rvWlvTVoOEzHpVvnY7hhk6BsEe/rd+Fxk t4vLWc1pcNJniy4czXyJZtuk1fpVJG4koqsRJ6tdXCMM/6EkYY6T1khsPzNZ/D7jRn72Bp EhvlOm4t8qQH5C9letCCvMw0gMuHd6gMPefbsliGPLPyTQQvNXkQOdQl5mxXCNxHNusznq S6LRAJ5NfaXklZ+LsDkMg6p9AWoQP2lv0JsxJCv17ZPwsDu1Bn0U0LiQ4HR7cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700841963; 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=X260RAJqiJpf6XJZLFb4aiqp20sSAZarwHLLOYGGTVU=; b=Lv0lrk69/syK75QD8zASAz2WYf+DhogpWrYD0jss0Z+hjeH/vnB+ylQ0VOn4IJAFC1JNTl THeT3kjuk/kVyML+rgG18WlyXtccFVDTKdy+qAByoB6Enyg9sPz0p/v17mxAs1SCRqJ66r ygda4RUmsNSIDf1jWTWIuB/b8svAM2z0FapKQBmyrFQqzGsi7Ylx3ZUU1V6SfE7htVH0OD 9fns4/z5WDe05GXNdL5N+x+0M186B89KnXX46WmqsePFWAMpPi+DsItV7XPkBfsP6vrrSh okCi34oglw8Aqh/4u73/6LIkSrIv3liHMYN/vNOWGZTL9QfippSHNPTAAcVFYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700841963; a=rsa-sha256; cv=none; b=Ib7p4UFmMt2xYnIl9GpXItvWFdEOrfxMp+YBgWkXg2JWnj+SfKdWAOubPhG3uFkgUF00h/ srXWzQeDrblsHkhWaRlNqN86g4abrSVKPa5BVslSioE38gmMg/B6lmUG7o2VNmm1Gc7hYE 3gqljQLJrDVFyWCpHTpVMeG5UZpzMIuE9qPX98jWK+Nl7P4n/OomczeG5iPsOK4SFpZ4PH rkWwJJ3+daIMsMee1cglytAY3F9uCo6ueoS8OJupXa0tTDX64z/rnbaBpQD0OgwaQScYvV Vhs5EP5Ub1CRQe1/f9y5GKIbnXA20WWWxKdkZlrGpah0Z1WaQoaagOAKmmSjXw== 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 4ScKbH0DQTzrXl; Fri, 24 Nov 2023 16:06:03 +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 3AOG62FB017865; Fri, 24 Nov 2023 16:06:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AOG62bS017862; Fri, 24 Nov 2023 16:06:02 GMT (envelope-from git) Date: Fri, 24 Nov 2023 16:06:02 GMT Message-Id: <202311241606.3AOG62bS017862@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 8d2996f51927 - main - sysutils/nut: Remove unnecessary validation for bus_num List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d2996f519277001777d07bd61c9cdab77a5c334 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=8d2996f519277001777d07bd61c9cdab77a5c334 commit 8d2996f519277001777d07bd61c9cdab77a5c334 Author: Xin LI AuthorDate: 2023-11-24 15:52:06 +0000 Commit: Cy Schubert CommitDate: 2023-11-24 16:03:39 +0000 sysutils/nut: Remove unnecessary validation for bus_num The libusb_get_bus_number() function serves as a simple accessor for the bus number of the opaque device struct. Unlike libusb_get_port_number(), it does not have the ability to convey errors back to the caller, and a bus number of 0 is a valid value. Therefore, any validation around bus_num is redundant. This commit removes the unnecessary validation code related to bus_num. Signed-off-by: Xin LI PR: 275293 Upstream commit: 4aeb199eb Upstream Pull Request: https://github.com/networkupstools/nut/pull/2198/ --- sysutils/nut/Makefile | 2 +- sysutils/nut/files/patch-drivers_libusb1.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index a22dd514509b..d179892a49e1 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,6 +1,6 @@ PORTNAME= nut PORTVERSION= 2.8.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= http://www.networkupstools.org/source/${PORTVERSION:R}/ diff --git a/sysutils/nut/files/patch-drivers_libusb1.c b/sysutils/nut/files/patch-drivers_libusb1.c new file mode 100644 index 000000000000..8e778ecf8707 --- /dev/null +++ b/sysutils/nut/files/patch-drivers_libusb1.c @@ -0,0 +1,18 @@ +--- drivers/libusb1.c.orig 2023-11-24 07:19:04.377537000 -0800 ++++ drivers/libusb1.c 2023-11-24 07:20:06.065188000 -0800 +@@ -263,14 +263,7 @@ + libusb_free_device_list(devlist, 1); + fatal_with_errno(EXIT_FAILURE, "Out of memory"); + } +- if (bus_num > 0) { +- sprintf(curDevice->Bus, "%03d", bus_num); +- } else { +- upsdebugx(1, "%s: invalid libusb bus number %i", +- __func__, bus_num); +- free(curDevice->Bus); +- curDevice->Bus = NULL; +- } ++ sprintf(curDevice->Bus, "%03d", bus_num); + + device_addr = libusb_get_device_address(device); + curDevice->Device = (char *)malloc(4);