[libvirt] [PATCH 1/2] test: fix call to virFDStreamOpenFile in testDomainScreenshot

Claudio Bley cbley at av-test.de
Tue Sep 24 12:32:43 UTC 2013


At Tue, 24 Sep 2013 05:53:41 -0600,
Eric Blake wrote:
> 
> On 09/24/2013 03:57 AM, Claudio Bley wrote:
> > N.B.  This had no ill effects as long as O_RDONLY is defined to
> >       to be 0, such that the expression (O_RDONLY < 0) yielded 0
> >       again.
> > 
> > Signed-off-by: Claudio Bley <cbley at av-test.de>
> > ---
> >  src/test/test_driver.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> > index 47c9d38..e1197c9 100644
> > --- a/src/test/test_driver.c
> > +++ b/src/test/test_driver.c
> > @@ -5862,7 +5862,7 @@ testDomainScreenshot(virDomainPtr dom ATTRIBUTE_UNUSED,
> >      if (VIR_STRDUP(ret, "image/png") < 0)
> >          return NULL;
> >  
> > -    if (virFDStreamOpenFile(st, PKGDATADIR "/libvirtLogo.png", 0, 0, O_RDONLY < 0))
> > +    if (virFDStreamOpenFile(st, PKGDATADIR "/libvirtLogo.png", 0, 0, O_RDONLY) < 0)
> 
> ACK.  Embarrassing that even Coverity doesn't flag this blatant bug.

> On 09/24/2013 03:57 AM, Claudio Bley wrote:
> > On win32, using text mode for binary files might result in short
> > reads since ASCII character 0x1A is interpreted as EOF. Also, it
> > could lead to problems using the seek functions because of the \r
> > handling.
> > 
> > Signed-off-by: Claudio Bley <cbley at av-test.de>
> > ---
> >  src/fdstream.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> ACK.

Thanks, both pushed now.

Claudio
n-- 
AV-Test GmbH, Henricistraße 20, 04155 Leipzig, Germany
Phone: +49 341 265 310 19
Web:<http://www.av-test.org>

Eingetragen am / Registered at: Amtsgericht Stendal (HRB 114076)
Geschaeftsfuehrer (CEO): Andreas Marx, Guido Habicht, Maik Morgenstern




More information about the libvir-list mailing list