Re: PATCH: Process QEMU monitor at startup

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

 



On Fri, 2007-03-02 at 15:34 +0000, Daniel P. Berrange wrote:
> On Fri, Mar 02, 2007 at 03:06:56PM +0000, Mark McLoughlin wrote:

> > 
> > 	index() is a bit odd, why not strstr() ?
> 
> Well we're only looking for a single character match - index() is for
> single characters, strstr() is for strings.

	Sorry, strchr() (which is in the C standard itself, whereas index() is
marked legacy in POSIX ... apparently)

> > > +        if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) == 0)
> > 
> > 	Um, why not bind() (with SO_REUSEADDR)?
> 
> No particular reason - either will work just fine.

	I've never noticed it done with connect() anywhere else, I guess
because you'd have the same obvious race ...

	I dunno, bind() will fail quickly when we probe a port, whereas
connect() will succeed more slowly and cause another context switch etc.
Not a big deal, but ...

Cheers,
Mark.


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]