提交 acdc3f0c 编写于 作者: J Juan Quintela 提交者: Anthony Liguori

check pipe() return value

Signed-off-by: NJuan Quintela <quintela@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 fb7e378c
......@@ -156,15 +156,18 @@ quit:
return;
}
static void xen_domain_watcher(void)
static int xen_domain_watcher(void)
{
int qemu_running = 1;
int fd[2], i, n, rc;
char byte;
pipe(fd);
if (pipe(fd) != 0) {
qemu_log("%s: Huh? pipe error: %s\n", __FUNCTION__, strerror(errno));
return -1;
}
if (fork() != 0)
return; /* not child */
return 0; /* not child */
/* close all file handles, except stdio/out/err,
* our watch pipe and the xen interface handle */
......@@ -238,7 +241,9 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk,
}
qemu_log("xen: created domain %d\n", xen_domid);
atexit(xen_domain_cleanup);
xen_domain_watcher();
if (xen_domain_watcher() == -1) {
goto err;
}
xenstore_domain_init1(kernel, ramdisk, cmdline);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册