qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] qtest: kill QEMU process on g_assert() fail


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 3/3] qtest: kill QEMU process on g_assert() failure
Date: Tue, 18 Feb 2014 15:44:23 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Feb 18, 2014 at 10:55:56AM +0100, Markus Armbruster wrote:
> Stefan Hajnoczi <address@hidden> writes:
> 
> > On Mon, Feb 17, 2014 at 05:49:31PM +0100, Markus Armbruster wrote:
> >> Stefan Hajnoczi <address@hidden> writes:
> >> >      if (s->qemu_pid != -1) {
> >> >          kill(s->qemu_pid, SIGTERM);
> >> >          waitpid(s->qemu_pid, &status, 0);
> >> >      }
> >> >  
> >> > -    close(s->fd);
> >> > -    close(s->qmp_fd);
> >> > +    if (s->fd != -1) {
> >> > +        close(s->fd);
> >> > +    }
> >> > +    if (s->qmp_fd != -1) {
> >> > +        close(s->qmp_fd);
> >> > +    }
> >> 
> >> I generally don't bother to avoid close(-1).
> >
> > When I drive on the highway I stay on the lanes but I guess I could just
> > slide along the side barriers :).  It's a style issue but close(-1)
> > annoys me in strace so I try to avoid doing it.
> 
> For me, it's in the same category as free(NULL).

Understood.  I'll drop it from the next patch.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]