mirror of https://gitee.com/openkylin/libvirt.git
Fixed missing return value checks on write
This commit is contained in:
parent
85e9f9fb47
commit
f58ac222be
|
@ -919,11 +919,17 @@ int qemudStartVMDaemon(struct qemud_server *server,
|
||||||
|
|
||||||
tmp = argv;
|
tmp = argv;
|
||||||
while (*tmp) {
|
while (*tmp) {
|
||||||
write(vm->logfile, *tmp, strlen(*tmp));
|
if (write(vm->logfile, *tmp, strlen(*tmp)) < 0)
|
||||||
write(vm->logfile, " ", 1);
|
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++;
|
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) {
|
if (qemudExec(server, argv, &vm->pid, &vm->stdout, &vm->stderr) == 0) {
|
||||||
vm->id = server->nextvmid++;
|
vm->id = server->nextvmid++;
|
||||||
|
|
Loading…
Reference in New Issue