[vlc-devel] [PATCH] rootwrap: make setsockopt 1 usage consistent

Tristan Matthews tmatth at videolan.org
Sun Nov 22 21:14:44 CET 2020


On Sun, Nov 22, 2020 at 2:14 PM Lyndon Brown <jnqnfe at gmail.com> wrote:
>
> On Sun, 2020-11-22 at 13:32 -0500, Tristan Matthews wrote:
> ---
>  bin/rootwrap.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/bin/rootwrap.c b/bin/rootwrap.c
> index 0258773b90..ed8d4bdf0b 100644
> --- a/bin/rootwrap.c
> +++ b/bin/rootwrap.c
> @@ -161,12 +161,10 @@ static void rootprocess (int fd)
>          sock = socket (family, SOCK_STREAM, IPPROTO_TCP);
>          if (sock != -1)
>          {
> -            const int val = 1;
> -
> -            setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &val, sizeof
> (val));
> +            setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &(int){ 1 },
> sizeof (int));
>  #ifdef AF_INET6
>              if (addr.sa.sa_family == AF_INET6)
> -                setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, &val,
> sizeof (val));
> +                setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY,  &(int){
> 1 }, sizeof (int));
>
>
> nit: you've added a redundant extra space before the second instance
> here


Good catch, fixed.

Best,
-t


More information about the vlc-devel mailing list