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

Marc-André Lureau mlureau at redhat.com
Thu Jan 15 09:03:22 PST 2015


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.


More information about the Spice-devel mailing list