aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/utils.c
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-08-01 12:55:10 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-08-01 12:55:10 +0100
commitb1757490f0d13d1525e9d6a589188ddf4acafbbf (patch)
tree49528945fffde6c92ddfefa5bafd852e04a09ba9 /tools/xenstore/utils.c
parent019e22bb40852a517dd5b678dba6ef660c606a15 (diff)
downloadxen-b1757490f0d13d1525e9d6a589188ddf4acafbbf.tar.gz
xen-b1757490f0d13d1525e9d6a589188ddf4acafbbf.tar.bz2
xen-b1757490f0d13d1525e9d6a589188ddf4acafbbf.zip
xenstored: Do not write to stderr if we are daemonised!
This fixes client reader-thread deaths in which a 'garbage string' was being read instead of a well-formed message header. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/xenstore/utils.c')
-rw-r--r--tools/xenstore/utils.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/xenstore/utils.c b/tools/xenstore/utils.c
index 45e71efd14..d7f5219a87 100644
--- a/tools/xenstore/utils.c
+++ b/tools/xenstore/utils.c
@@ -8,20 +8,19 @@
#include <fcntl.h>
#include <sys/types.h>
#include <signal.h>
-
#include "utils.h"
void xprintf(const char *fmt, ...)
{
- static FILE *out = NULL;
va_list args;
- if (!out)
- out = stderr;
+
+ if (!stderr)
+ return; /* could trace()? */
va_start(args, fmt);
- vfprintf(out, fmt, args);
+ vfprintf(stderr, fmt, args);
va_end(args);
- fflush(out);
+ fflush(stderr);
}
void barf(const char *fmt, ...)