[Spice-devel] [PATCH spice-xpi] controller: initialize correctly Connect() loop condition

Marc-André Lureau mlureau at redhat.com
Mon Jun 6 03:52:54 PDT 2011


hi

----- Original Message -----
> On Mon, Jun 06, 2011 at 01:52:08AM +0200, Marc-André Lureau wrote:
> > Ping! can somebody review? it shouldn't take too long.
> >
> 
> I just tried matching this patch to upstream and it doesn't - there rc
> is initialized directly
> with the connect call:
> 
> int rc = connect(m_client_socket, (struct sockaddr *) &remote,
> strlen(remote.sun_path) + sizeof(remote.sun_family));
> if (rc == -1)
> ...
> 
> So which repo are you working with?
> 

fdo git master:

http://cgit.freedesktop.org/spice/spice-xpi/tree/SpiceXPI/src/plugin/controller.cpp#n128


-- 
Marc-André Lureau

> > On Tue, May 24, 2011 at 10:12 PM, Marc-André Lureau
> > <marcandre.lureau at gmail.com> wrote:
> > > Without initialization of rc, it may happen connection with
> > > controller
> > > socket just don't happen and the client will wait hanging...
> > > ---
> > >  SpiceXPI/src/plugin/controller.cpp | 2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/SpiceXPI/src/plugin/controller.cpp
> > > b/SpiceXPI/src/plugin/controller.cpp
> > > index a3edccb..3a78b5c 100644
> > > --- a/SpiceXPI/src/plugin/controller.cpp
> > > +++ b/SpiceXPI/src/plugin/controller.cpp
> > > @@ -125,7 +125,7 @@ int SpiceController::Connect(const int
> > > nRetries)
> > >     if (nRetries < 0)
> > >         return -1;
> > >
> > > - int rc;
> > > + int rc = -1;
> > >     int sleep_time = 0;
> > >
> > >     // try to connect for specified count
> > > --
> > > 1.7.5.1
> > >
> > >
> >
> >
> >
> > --
> > Marc-André Lureau
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list