From f58ac222be74ec522f341c01f818fc7cb0025ac9 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 18 May 2007 19:00:37 +0000 Subject: [PATCH] Fixed missing return value checks on write --- qemud/qemud.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/qemud/qemud.c b/qemud/qemud.c index 7dcb9a2c54..171da4a0b6 100644 --- a/qemud/qemud.c +++ b/qemud/qemud.c @@ -919,11 +919,17 @@ int qemudStartVMDaemon(struct qemud_server *server, tmp = argv; while (*tmp) { - write(vm->logfile, *tmp, strlen(*tmp)); - write(vm->logfile, " ", 1); + if (write(vm->logfile, *tmp, strlen(*tmp)) < 0) + qemudLog(QEMUD_WARN, "Unable to write argv to logfile %d: %s", + errno, strerror(errno)); + if (write(vm->logfile, " ", 1) < 0) + qemudLog(QEMUD_WARN, "Unable to write argv to logfile %d: %s", + errno, strerror(errno)); tmp++; } - write(vm->logfile, "\n", 1); + if (write(vm->logfile, "\n", 1) < 0) + qemudLog(QEMUD_WARN, "Unable to write argv to logfile %d: %s", + errno, strerror(errno)); if (qemudExec(server, argv, &vm->pid, &vm->stdout, &vm->stderr) == 0) { vm->id = server->nextvmid++;