From owner-svn-src-all@freebsd.org Thu Mar 16 04:32:56 2017 Return-Path: Delivered-To: svn-src-all@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 272D5D0D09F for ; Thu, 16 Mar 2017 04:32:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (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 E77071FBD for ; Thu, 16 Mar 2017 04:32:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x229.google.com with SMTP id m27so32825569iti.1 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=i2ObIWJ+T3vi4b4BWZ/g/0fE6pyR6SQL2EG/yQnP06jDZy4L1YvVRFLI0RZEBavwCX fNOGoY5ta+Ewb6934pB0OVQsVGfrW+tOnf24ZNcO/Kph7il8zUnu0Dw6pWO4BXXuXcW0 TBao5kNYDVyaGqhktvgVzj23x1dPdn01M6YDPEUH7qtjsl7I+lS0PPOVgcL0oUz80SVx SN/g2h5yVpaK/6rCZmJkflXJO8LWeirbi6rG/wFp7GGhVEj2/Zwv9yLSSvfYFnPx1eQx vBuxRbffDGf4SV+2RHnaB7DbqgbvSQDvFaC6JBx4PmLXibfcKrtZSZD4n5uEm8U3uTmL wc0w== X-Gm-Message-State: AFeK/H1HavU8fVSqyf/QYaAg4+mtDIiVSpBanqzUWzqcst+3zffFO78v8WnSpzjaW/0hT72D5b2rOB22jmsuGw== 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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