xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	wei.liu2@citrix.com, ian.jackson@eu.citrix.com
Subject: [PATCH v3 1/7] xenstore: correct test for opened logfile in reopen_log()
Date: Wed, 22 Feb 2017 16:28:45 +0100	[thread overview]
Message-ID: <20170222152851.20099-2-jgross@suse.com> (raw)
In-Reply-To: <20170222152851.20099-1-jgross@suse.com>

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@suse.com>
---
 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@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-02-22 15:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 15:28 [PATCH v3 0/7] xenstore: enhance runtime debug capabilities Juergen Gross
2017-02-22 15:28 ` Juergen Gross [this message]
2017-02-23 10:36   ` [PATCH v3 1/7] xenstore: correct test for opened logfile in reopen_log() Wei Liu
2017-02-22 15:28 ` [PATCH v3 2/7] xenstore: rename XS_DEBUG wire command Juergen Gross
2017-02-23 11:06   ` Wei Liu
2017-02-22 15:28 ` [PATCH v3 3/7] xenstore: Split out XS_CONTROL action to dedicated source file Juergen Gross
2017-02-23 11:06   ` Wei Liu
2017-02-22 15:28 ` [PATCH v3 4/7] xenstore: enhance control command support Juergen Gross
2017-02-23 11:06   ` Wei Liu
2017-02-24  5:50     ` Juergen Gross
2017-02-22 15:28 ` [PATCH v3 5/7] xenstore: add support for changing log functionality dynamically Juergen Gross
2017-02-23 11:06   ` Wei Liu
2017-02-22 15:28 ` [PATCH v3 6/7] xenstore: make memory report available via XS_CONTROL Juergen Gross
2017-02-23 11:06   ` Wei Liu
2017-02-22 15:28 ` [PATCH v3 7/7] xenstore: remove memory report command line support Juergen Gross
2017-02-23 11:06   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170222152851.20099-2-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).