Re: [patch] remove negative socklen_t checks

From: Xin Li <delphij_at_delphij.net>
Date: Wed, 20 Feb 2013 10:42:36 -0800
-----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) _at__at_ -353,8 +353,6 _at__at_
> 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_at_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-----
Received on Wed Feb 20 2013 - 17:42:42 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:35 UTC