From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Make xenstored EOF-safe
Date: Tue, 27 Nov 2007 15:00:12 +0000 [thread overview]
Message-ID: <20071127150012.GA17443@implementation.uk.xensource.com> (raw)
As bug 968 suggests, xenstored must properly handle EOF from clients.
From: Pavel Kankovsky <peak@argo.troja.mff.cuni.cz>
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
diff -r 6fd17d0dcbcd tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c Tue Nov 27 12:49:16 2007 +0000
+++ b/tools/xenstore/xenstored_core.c Tue Nov 27 14:56:35 2007 +0000
@@ -1266,7 +1266,7 @@ static void handle_input(struct connecti
if (in->inhdr) {
bytes = conn->read(conn, in->hdr.raw + in->used,
sizeof(in->hdr) - in->used);
- if (bytes < 0)
+ if (bytes <= 0)
goto bad_client;
in->used += bytes;
if (in->used != sizeof(in->hdr))
@@ -1288,7 +1288,7 @@ static void handle_input(struct connecti
bytes = conn->read(conn, in->buffer + in->used,
in->hdr.msg.len - in->used);
- if (bytes < 0)
+ if (bytes <= 0)
goto bad_client;
in->used += bytes;
next reply other threads:[~2007-11-27 15:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-27 15:00 Samuel Thibault [this message]
2007-11-28 3:34 ` [PATCH] Make xenstored EOF-safe Keir Fraser
2007-11-28 10:11 ` Samuel Thibault
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=20071127150012.GA17443@implementation.uk.xensource.com \
--to=samuel.thibault@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.