tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: soreserve() return value



At Thu, 23 Jul 2009 11:02:42 -0400, Sean Boudreau <seanb%qnx.com@localhost> 
wrote:
Subject: soreserve() return value
> 
> Index: sys/kern/uipc_socket2.c
> ===================================================================
> RCS file: /cvsroot/src/sys/kern/uipc_socket2.c,v
> retrieving revision 1.102
> diff -u -r1.102 uipc_socket2.c
> --- sys/kern/uipc_socket2.c   9 Apr 2009 00:43:38 -0000       1.102
> +++ sys/kern/uipc_socket2.c   23 Jul 2009 14:05:13 -0000
> @@ -279,7 +279,10 @@
>       so->so_rcv.sb_mowner = head->so_rcv.sb_mowner;
>       so->so_snd.sb_mowner = head->so_snd.sb_mowner;
>  #endif
> -     (void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
> +     if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) != 0) {
> +             soput(so);
> +             return NULL;
> +     }
>       so->so_snd.sb_lowat = head->so_snd.sb_lowat;
>       so->so_rcv.sb_lowat = head->so_rcv.sb_lowat;
>       so->so_rcv.sb_timeo = head->so_rcv.sb_timeo;

It does look like FreeBSD's sonewconn() checks the return value of
soreserve() these days, though their code has transmuted quite a bit
beyond just doing that....

-- 
                                                Greg A. Woods
                                                Planix, Inc.

<woods%planix.com@localhost>       +1 416 218-0099        http://www.planix.com/

Attachment: pgpbILb4nny1j.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index