From owner-svn-src-all@FreeBSD.ORG Thu May 7 20:13:17 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B1B3106566B; Thu, 7 May 2009 20:13:17 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id 240D88FC0C; Thu, 7 May 2009 20:13:16 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id n47KDFv9014439; Thu, 7 May 2009 14:13:16 -0600 (MDT) Message-ID: <4A0340D6.3060704@FreeBSD.org> Date: Thu, 07 May 2009 14:13:10 -0600 From: Jamie Gritton User-Agent: Thunderbird 2.0.0.19 (X11/20090109) MIME-Version: 1.0 To: Juli Mallett References: <200905071946.n47JkTmQ066266@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9342/Thu May 7 11:33:10 2009 on gritton.org X-Virus-Status: Clean Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r191898 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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, 07 May 2009 20:13:18 -0000 True. Int isn't really the proper type for the situation, but it's what the function uses, signed and too-short as it may be. I fall into this habit of thinking "lengths are size_t" when it's untrue in a lot of existing code. Juli Mallett wrote: > Worth remembering: the difference is not just that their sizes may > (often do) differ. size_t is unsigned. ssize_t is signed. An > unqualified int is signed. > > On Thu, May 7, 2009 at 12:46 PM, Jamie Gritton wrote: >> Author: jamie >> Date: Thu May 7 19:46:29 2009 >> New Revision: 191898 >> URL: http://svn.freebsd.org/changeset/base/191898 >> >> Log: >> Give vfs_getopt the type it's expecting. >> Write 100 times: "32 bits is so twentieth century." >> >> Noticed by: dchagin >> >> Modified: >> head/sys/compat/linux/linux_mib.c >> >> Modified: head/sys/compat/linux/linux_mib.c >> ============================================================================== >> --- head/sys/compat/linux/linux_mib.c Thu May 7 19:17:06 2009 (r191897) >> +++ head/sys/compat/linux/linux_mib.c Thu May 7 19:46:29 2009 (r191898) >> @@ -223,8 +223,7 @@ linux_prison_check(void *obj __unused, v >> { >> struct vfsoptlist *opts = data; >> char *osname, *osrelease; >> - size_t len; >> - int error, oss_version; >> + int error, len, oss_version; >> >> /* Check that the parameters are correct. */ >> (void)vfs_flagopt(opts, "linux", NULL, 0); >> @@ -263,8 +262,7 @@ linux_prison_set(void *obj, void *data) >> struct prison *pr = obj; >> struct vfsoptlist *opts = data; >> char *osname, *osrelease; >> - size_t len; >> - int error, gotversion, nolinux, oss_version, yeslinux; >> + int error, gotversion, len, nolinux, oss_version, yeslinux; >> >> /* Set the parameters, which should be correct. */ >> yeslinux = vfs_flagopt(opts, "linux", NULL, 0); >> >