Patchwork [04/10] migrate_fd_cleanup: accept any negative qemu_fclose() value as error

login
register
mail settings
Submitter Eduardo Habkost
Date Nov. 10, 2011, 12:41 p.m.
Message ID <1320928908-19076-5-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/124864/
State New
Headers show

Comments

Eduardo Habkost - Nov. 10, 2011, 12:41 p.m.
Also, we now return the qemu_fclose() value unchanged to the caller. For
reference, the migrate_fd_cleanup() callers are the following:

- migrate_fd_completed(): any negative value is considered an
  error, so the change is OK.
- migrate_fd_error(): doesn't check the migrate_fd_cleanup() return value
- migrate_fd_cancel(): doesn't check the migrate_fd_cleanup() return
  value

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 migration.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Patch

diff --git a/migration.c b/migration.c
index 4b17566..5a33003 100644
--- a/migration.c
+++ b/migration.c
@@ -172,9 +172,7 @@  static int migrate_fd_cleanup(MigrationState *s)
 
     if (s->file) {
         DPRINTF("closing file\n");
-        if (qemu_fclose(s->file) != 0) {
-            ret = -1;
-        }
+        ret = qemu_fclose(s->file);
         s->file = NULL;
     } else {
         if (s->mon) {