From owner-svn-ports-all@freebsd.org Fri Aug 28 22:16:14 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F92D3C449F; Fri, 28 Aug 2020 22:16:14 +0000 (UTC) (envelope-from adridg@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BdYpQ2Hvlz4X84; Fri, 28 Aug 2020 22:16:14 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31FE91BCAB; Fri, 28 Aug 2020 22:16:14 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07SMGE3Z076695; Fri, 28 Aug 2020 22:16:14 GMT (envelope-from adridg@FreeBSD.org) Received: (from adridg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07SMGDSw076694; Fri, 28 Aug 2020 22:16:13 GMT (envelope-from adridg@FreeBSD.org) Message-Id: <202008282216.07SMGDSw076694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adridg set sender to adridg@FreeBSD.org using -f From: Adriaan de Groot Date: Fri, 28 Aug 2020 22:16:13 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r546841 - in head/sysutils/zbackup: . files X-SVN-Group: ports-head X-SVN-Commit-Author: adridg X-SVN-Commit-Paths: in head/sysutils/zbackup: . files X-SVN-Commit-Revision: 546841 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 22:16:14 -0000 Author: adridg Date: Fri Aug 28 22:16:13 2020 New Revision: 546841 URL: https://svnweb.freebsd.org/changeset/ports/546841 Log: Fix sysutils/zbackup in the face of modern C++ The "smart" pointer has had a serious bug for years, but the method with the bug isn't used :S Fix the bug, throw in some gratuitous C++ modernizations while we're at it. Patches submitted upstream. Added: head/sysutils/zbackup/files/patch-sptr.hh (contents, props changed) Modified: head/sysutils/zbackup/Makefile Modified: head/sysutils/zbackup/Makefile ============================================================================== --- head/sysutils/zbackup/Makefile Fri Aug 28 22:11:24 2020 (r546840) +++ head/sysutils/zbackup/Makefile Fri Aug 28 22:16:13 2020 (r546841) @@ -2,7 +2,7 @@ PORTNAME= zbackup PORTVERSION= 1.4.4 -PORTREVISION= 15 +PORTREVISION= 16 CATEGORIES= sysutils MAINTAINER= ports@FreeBSD.org Added: head/sysutils/zbackup/files/patch-sptr.hh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/zbackup/files/patch-sptr.hh Fri Aug 28 22:16:13 2020 (r546841) @@ -0,0 +1,47 @@ +--- sptr.hh.orig 2015-09-16 07:28:04 UTC ++++ sptr.hh +@@ -25,9 +25,9 @@ class sptr_base + + public: + +- sptr_base(): p( 0 ), count( 0 ) {} ++ sptr_base(): p( nullptr ), count( nullptr ) {} + +- sptr_base( T * p_ ): p( p_ ), count( p ? new unsigned( 1 ) : 0 ) ++ sptr_base( T * p_ ): p( p_ ), count( p ? new unsigned( 1 ) : nullptr ) + { + } + +@@ -48,27 +48,27 @@ class sptr_base + { + delete count; + +- count = 0; ++ count = nullptr; + + if ( p ) + { + T * p_ = p; + +- p = 0; ++ p = nullptr; + + delete p_; + } + } + else + { +- p = 0; +- count = 0; ++ p = nullptr; ++ count = nullptr; + } + } + } + + unsigned use_count() const +- { return count; } ++ { return *count; } + + sptr_base & operator = ( sptr_base const & other ) + { if ( &other != this ) { reset(); p = other.p; count = other.count; increment(); }