提交 8160bfbc 编写于 作者: E Eduardo Habkost 提交者: Anthony Liguori

unix_close(): check for close() errors too (v2)

In case close() fails, we want to report the error back.

Changes v1 -> v2:
 - Use braces on if statement to match coding style
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 61a5872f
......@@ -40,12 +40,15 @@ static int unix_write(MigrationState *s, const void * buf, size_t size)
static int unix_close(MigrationState *s)
{
int r = 0;
DPRINTF("unix_close\n");
if (s->fd != -1) {
close(s->fd);
if (close(s->fd) < 0) {
r = -errno;
}
s->fd = -1;
}
return 0;
return r;
}
static void unix_wait_for_connect(void *opaque)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册