From owner-svn-src-head@freebsd.org Thu Mar 16 04:32:56 2017 Return-Path: Delivered-To: svn-src-head@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 2B65CD0D0A0 for ; Thu, 16 Mar 2017 04:32:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8D431FBE for ; Thu, 16 Mar 2017 04:32:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id g138so32964595itb.0 for ; Wed, 15 Mar 2017 21:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=N9Zz1cgDrkqCB3NwT03UaWPdmNqrmnHCKrq2dz32rTY=; b=DgSwzZJoe8cQIRDM+Y51UJyGsuRyUm7p38whLruDYzWzFTmh4/3xMwagsUUe5zf0uw dMsKSFJHsa1xtaw1+8mqRmie2Pfem5k53iXYOlCtmIwOGdx+eoG0YHAu5CQK+aqk0m3I jFbPy/eUFpCY8uxhQpKhGuFjN4XZkejMuWoXUCk05VurcDiJU5WbX32Q6tfpXx0Hi10b ZcfokWgqGj/d4xAMKPJ/ENtrMml9UQvPAKgw4MAKtXPa2wUG04xU1uTpqzukcT1vIHKk gVqiC4Hr+g9T3S1xGXkd8DhhEZySoeBYU8v1omL/KE2usyYFtqftciWgEqg4lFgGdKZ4 YH6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=N9Zz1cgDrkqCB3NwT03UaWPdmNqrmnHCKrq2dz32rTY=; b=PdB1t3lBWbX4tjFBzvRDQbuJExZfJ5soNimc3Iaf2653VDHgmpjRFqa+Mh0LX9MaWi A0EMdeGsQuj3dFZ6wf5nm/gIVb+guW4GewNCOS5HdYkqKJbHqLCDxYTWwNSbsQidnisL qK1RTjH0mT44FEnkL6Ln4WLdalI+ILR3HQp8eVLwjW+ZUQUdBi4w6xPW+O28KUkAvdZ7 UwqCkjtO9dylyWO8VJgODMkgeVAxLAiR3LYoVjAyxHcIOr4GKrDulQeNZ8UOpH7uX2+C FBpHSs6c9E0fjgQLIBpOr+PxBB3C0mKwU7RhMurXupOLbbVXRJh0XwUaQZUq67UympJH t4bQ== X-Gm-Message-State: AFeK/H3yZI8JR4DFyanSe4iflgHbtUv+W0+vBZxWkyoCABW9l3QtZfIUwkQynwqxByEZsVZjgEnxL8mAyFutQg== X-Received: by 10.36.34.212 with SMTP id o203mr10299530ito.103.1489638775135; Wed, 15 Mar 2017 21:32:55 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.134.129 with HTTP; Wed, 15 Mar 2017 21:32:54 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <201703160231.v2G2VgxK082641@repo.freebsd.org> References: <201703160231.v2G2VgxK082641@repo.freebsd.org> From: Warner Losh Date: Wed, 15 Mar 2017 22:32:54 -0600 X-Google-Sender-Auth: LW1jfRqUJlExKMZbrQvAHk071NM Message-ID: Subject: Re: svn commit: r315360 - head/lib/libkvm To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2017 04:32:56 -0000 On Wed, Mar 15, 2017 at 8:31 PM, Ngie Cooper wrote: > Author: ngie > Date: Thu Mar 16 02:31:42 2017 > New Revision: 315360 > URL: https://svnweb.freebsd.org/changeset/base/315360 > > Log: > 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. No, it can't. The C language requires all integral expressions that evaluate to zero to convert to the NULL pointer. This is independent of the internal representation of the NULL pointer. So this change is an NOP for all compilers. It's a good STYLE change. Warner