Date: Wed, 20 Feb 2013 10:42:36 -0800 From: Xin Li <delphij@delphij.net> To: Sergey Kandaurov <pluknet@gmail.com> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: [patch] remove negative socklen_t checks Message-ID: <5125191C.6010901@delphij.net> In-Reply-To: <CAE-mSOKJHqov7kHKpKFRw%2Bcq5W%2B6du88GVNa2xvfLaoeO%2BE%2BuA@mail.gmail.com> References: <CAE-mSOKJHqov7kHKpKFRw%2Bcq5W%2B6du88GVNa2xvfLaoeO%2BE%2BuA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 02/20/13 09:19, Sergey Kandaurov wrote:
> Hi.
>
> These checks are useless after the address length argument is
> converted to socklen_t (up to SUSv2). Any objections?
No objection in general but there is a minor style issue, see below.
[...]
> Index: sys/kern/uipc_syscalls.c
> ===================================================================
>
>
- --- sys/kern/uipc_syscalls.c (revision 246354)
> +++ sys/kern/uipc_syscalls.c (working copy) @@ -353,8 +353,6 @@
> kern_accept(struct thread *td, int s, struct socka
>
> if (name) { *name = NULL; - if (*namelen < 0) -
> return (EINVAL); }
The { } for if () is no longer needed now per style(9).
By the way I wonder why there is no compiler warning for this -- or do
we compile kernel without signedness warnings? Just curious...
Cheers,
- --
Xin LI <delphij@delphij.net> https://www.delphij.net/
FreeBSD - The Power to Serve! Live free or die
-----BEGIN PGP SIGNATURE-----
iQEcBAEBCgAGBQJRJRkcAAoJEG80Jeu8UPuzagkIAICE9uJzbLS8MvPPYLEMCop3
mamlq7AOJSpGfEyBzB0CZV2badJC91LEtUGADMN0CANPbvX6EpDsYoPygpXBuxei
etNelbp1+9jbqwV6yK+9FVCioRiMMLrPKkyh02+s1ZhWCf6kjz3Xl9MEYKUKYuV1
ay7xLcLnQMxOzf1oS7Sovm6NsIFnDC06WZ0PZDFdBtv7typtGblw3rrgWMsOnshL
x35C1UC8NgLnauMEOhX6Vr1zeRz+hqfw+YauCi/P+3chxfUgpe6XR551IN2h9xBU
mYTNEjLkRgX8u5sCHYGB16r/OZ3X59w1sJH/21ayrHuF0gNEmQbnMlBnA/krH94=
=iiGi
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5125191C.6010901>
