[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 1/7] xenstore: correct test for opened logfile in reopen_log()
On Wed, Feb 22, 2017 at 04:28:45PM +0100, Juergen Gross wrote: > As 0 is a valid file descriptor testing a descriptor to be valid > should be done via >= 0 instead of > 0. > > Signed-off-by: Juergen Gross <jgross@xxxxxxxx> > --- Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> Ian, this should be backported. > tools/xenstore/xenstored_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c > index 1e9b622..7b16338 100644 > --- a/tools/xenstore/xenstored_core.c > +++ b/tools/xenstore/xenstored_core.c > @@ -209,7 +209,7 @@ static void trigger_reopen_log(int signal > __attribute__((unused))) > static void reopen_log(void) > { > if (tracefile) { > - if (tracefd > 0) > + if (tracefd >= 0) > close(tracefd); > > tracefd = open(tracefile, O_WRONLY|O_CREAT|O_APPEND, 0600); > -- > 2.10.2 > _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |