Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 May 2009 14:13:10 -0600
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        Juli Mallett <jmallett@FreeBSD.org>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r191898 - head/sys/compat/linux
Message-ID:  <4A0340D6.3060704@FreeBSD.org>
In-Reply-To: <eaa228be0905071248rd0f20d3p1e186fa9d9534f46@mail.gmail.com>
References:  <200905071946.n47JkTmQ066266@svn.freebsd.org> <eaa228be0905071248rd0f20d3p1e186fa9d9534f46@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <jamie@freebsd.org> 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);
>>
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A0340D6.3060704>