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: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
static int unix_close(MigrationState *s)
{
static int unix_close(MigrationState *s)
{
DPRINTF("unix_close\n");
if (s->fd != -1) {
DPRINTF("unix_close\n");
if (s->fd != -1) {
+ if (close(s->fd) < 0) {
+ r = -errno;
+ }
}
static void unix_wait_for_connect(void *opaque)
}
static void unix_wait_for_connect(void *opaque)