Re: [PATCHv2 2/3] reds-stream: add reds_stream_get_family() function

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

 



Hi

----- Original Message -----
> On 01/12/2015 06:35 PM, Marc-André Lureau wrote:
> > ---
> >   server/reds_stream.c | 10 ++++++++++
> >   server/reds_stream.h |  1 +
> >   2 files changed, 11 insertions(+)
> >
> > diff --git a/server/reds_stream.c b/server/reds_stream.c
> > index 4b61e31..e0b6f43 100644
> > --- a/server/reds_stream.c
> > +++ b/server/reds_stream.c
> > @@ -226,6 +226,16 @@ ssize_t reds_stream_write(RedsStream *s, const void
> > *buf, size_t nbyte)
> >       return ret;
> >   }
> >   
> > +int reds_stream_get_family(RedsStream *s)
> > +{
> > +    spice_return_val_if_fail(s != NULL, -1);
> > +
> > +    if (s->socket == -1)
> > +        return -1;
> > +
> > +    return s->priv->info->laddr.sa_family;
> 
> Hi Marc-Andre,
> 
> Since laddr is marked as deprecated, probably better:
>      return s->priv->info-> laddr_ext.ss_family;

That makes sense, updated.
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]