From owner-svn-src-stable-10@freebsd.org Thu Mar 23 04:54:33 2017 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F89BD194C3; Thu, 23 Mar 2017 04:54:33 +0000 (UTC) (envelope-from ngie@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 mx1.freebsd.org (Postfix) with ESMTPS id F2F1D1C78; Thu, 23 Mar 2017 04:54:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2N4sWNH010411; Thu, 23 Mar 2017 04:54:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2N4sWxx010410; Thu, 23 Mar 2017 04:54:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703230454.v2N4sWxx010410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 23 Mar 2017 04:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r315787 - stable/10/lib/libkvm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2017 04:54:33 -0000 Author: ngie Date: Thu Mar 23 04:54:31 2017 New Revision: 315787 URL: https://svnweb.freebsd.org/changeset/base/315787 Log: MFC r315360: Return NULL instead of 0 on failure in _kvm_open, kvm_open{,2,files} This is being done for the following reasons: - kvm_open(3), etc says they will return NULL. - NULL by definition is (void*)0 per POSIX, but can be redefined, depending on the compiler, etc. Modified: stable/10/lib/libkvm/kvm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm.c ============================================================================== --- stable/10/lib/libkvm/kvm.c Thu Mar 23 04:50:50 2017 (r315786) +++ stable/10/lib/libkvm/kvm.c Thu Mar 23 04:54:31 2017 (r315787) @@ -224,7 +224,7 @@ failed: if (errout != 0) strlcpy(errout, kd->errbuf, _POSIX2_LINE_MAX); (void)kvm_close(kd); - return (0); + return (NULL); } kvm_t * @@ -235,7 +235,7 @@ kvm_openfiles(const char *uf, const char if ((kd = calloc(1, sizeof(*kd))) == NULL) { (void)strlcpy(errout, strerror(errno), _POSIX2_LINE_MAX); - return (0); + return (NULL); } kd->program = 0; return (_kvm_open(kd, uf, mf, flag, errout)); @@ -251,7 +251,7 @@ kvm_open(const char *uf, const char *mf, if (errstr != NULL) (void)fprintf(stderr, "%s: %s\n", errstr, strerror(errno)); - return (0); + return (NULL); } kd->program = errstr; return (_kvm_open(kd, uf, mf, flag, NULL));