From owner-svn-src-vendor@FreeBSD.ORG Mon Mar 9 20:43:16 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 576A2A42; Mon, 9 Mar 2015 20:43:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 37AFFA16; Mon, 9 Mar 2015 20:43:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t29KhFPQ030480; Mon, 9 Mar 2015 20:43:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t29KhF09030470; Mon, 9 Mar 2015 20:43:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201503092043.t29KhF09030470@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 9 Mar 2015 20:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r279822 - vendor/illumos/dist/tools/ctf/cvt X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 20:43:16 -0000 Author: markj Date: Mon Mar 9 20:43:14 2015 New Revision: 279822 URL: https://svnweb.freebsd.org/changeset/base/279822 Log: 5589 improper use of NULL in tools/ctf Reviewed by: David Höppner <0xffea@gmail.com> Reviewed by: Josef "Jeff" Sipek Approved by: Dan McDonald Author: Richard PALO illumos/illumos-gate@ad0b1ea5d69a45fe23c434277599e315f29a5fca Modified: vendor/illumos/dist/tools/ctf/cvt/ctf.c vendor/illumos/dist/tools/ctf/cvt/dwarf.c vendor/illumos/dist/tools/ctf/cvt/output.c Modified: vendor/illumos/dist/tools/ctf/cvt/ctf.c ============================================================================== --- vendor/illumos/dist/tools/ctf/cvt/ctf.c Mon Mar 9 20:29:16 2015 (r279821) +++ vendor/illumos/dist/tools/ctf/cvt/ctf.c Mon Mar 9 20:43:14 2015 (r279822) @@ -1216,7 +1216,7 @@ decompress_ctf(caddr_t cbuf, size_t cbuf (rc = inflate(&zstr, Z_NO_FLUSH)) != Z_STREAM_END || (rc = inflateEnd(&zstr)) != Z_OK) { warning("CTF decompress zlib error %s\n", zError(rc)); - return (NULL); + return (0); } debug(3, "reflated %lu bytes to %lu, pointer at %d\n", Modified: vendor/illumos/dist/tools/ctf/cvt/dwarf.c ============================================================================== --- vendor/illumos/dist/tools/ctf/cvt/dwarf.c Mon Mar 9 20:29:16 2015 (r279821) +++ vendor/illumos/dist/tools/ctf/cvt/dwarf.c Mon Mar 9 20:43:14 2015 (r279822) @@ -1714,7 +1714,7 @@ static const die_creator_t die_creators[ { DW_TAG_variable, DW_F_NOTDP, die_variable_create }, { DW_TAG_volatile_type, 0, die_volatile_create }, { DW_TAG_restrict_type, 0, die_restrict_create }, - { 0, NULL } + { 0, 0, NULL } }; static const die_creator_t * Modified: vendor/illumos/dist/tools/ctf/cvt/output.c ============================================================================== --- vendor/illumos/dist/tools/ctf/cvt/output.c Mon Mar 9 20:29:16 2015 (r279821) +++ vendor/illumos/dist/tools/ctf/cvt/output.c Mon Mar 9 20:43:14 2015 (r279822) @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Routines for preparing tdata trees for conversion into CTF data, and * for placing the resulting data into an output file. @@ -466,7 +464,7 @@ write_file(Elf *src, const char *srcname int pad; int i; - if (gelf_newehdr(dst, gelf_getclass(src)) == NULL) + if (gelf_newehdr(dst, gelf_getclass(src)) == 0) elfterminate(dstname, "Cannot copy ehdr to temp file"); gelf_getehdr(src, &sehdr); memcpy(&dehdr, &sehdr, sizeof (GElf_Ehdr)); @@ -482,7 +480,7 @@ write_file(Elf *src, const char *srcname */ if (sehdr.e_phnum != 0) { (void) elf_flagelf(dst, ELF_C_SET, ELF_F_LAYOUT); - if (gelf_newphdr(dst, sehdr.e_phnum) == NULL) + if (gelf_newphdr(dst, sehdr.e_phnum) == 0) elfterminate(dstname, "Cannot make phdrs in temp file"); for (i = 0; i < sehdr.e_phnum; i++) { @@ -616,7 +614,7 @@ write_file(Elf *src, const char *srcname } } - if (gelf_update_shdr(dscn, &shdr) == NULL) + if (gelf_update_shdr(dscn, &shdr) == 0) elfterminate(dstname, "Cannot update sect %s", sname); new_offset = (off_t)shdr.sh_offset;