[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 01/13] Coverity: Remove unreachable code.



---
 daemon/base64.c |    2 --
 daemon/debug.c  |    4 ----
 daemon/tar.c    |    2 --
 daemon/upload.c |    4 ----
 4 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/daemon/base64.c b/daemon/base64.c
index f55e1f5..8aca5b7 100644
--- a/daemon/base64.c
+++ b/daemon/base64.c
@@ -86,8 +86,6 @@ do_base64_in (const char *file)
   }
 
   if (pclose (fp) != 0) {
-    if (r == -1)                /* if r == 0, file transfer ended already */
-      cancel_receive ();
     reply_with_error ("base64 subcommand failed on file: %s", file);
     return -1;
   }
diff --git a/daemon/debug.c b/daemon/debug.c
index cd3e8a5..0ade2a4 100644
--- a/daemon/debug.c
+++ b/daemon/debug.c
@@ -549,10 +549,6 @@ do_debug_upload (const char *filename, int mode)
   }
 
   if (close (fd) == -1) {
-    int err = errno;
-    if (r == -1)                /* if r == 0, file transfer ended already */
-      cancel_receive ();
-    errno = err;
     reply_with_perror ("close: %s", filename);
     return -1;
   }
diff --git a/daemon/tar.c b/daemon/tar.c
index 39fce8c..74d7b05 100644
--- a/daemon/tar.c
+++ b/daemon/tar.c
@@ -127,8 +127,6 @@ do_tXz_in (const char *dir, const char *filter)
   }
 
   if (pclose (fp) != 0) {
-    if (r == -1)                /* if r == 0, file transfer ended already */
-      r = cancel_receive ();
     char *errstr = read_error_file ();
     reply_with_error ("tar subcommand failed on directory: %s: %s",
                       dir, errstr);
diff --git a/daemon/upload.c b/daemon/upload.c
index 2c42969..a1a37ae 100644
--- a/daemon/upload.c
+++ b/daemon/upload.c
@@ -103,10 +103,6 @@ upload (const char *filename, int flags, int64_t offset)
   }
 
   if (close (data.fd) == -1) {
-    err = errno;
-    if (r == -1)                /* if r == 0, file transfer ended already */
-      r = cancel_receive ();
-    errno = err;
     reply_with_perror ("close: %s", filename);
     return -1;
   }
-- 
1.7.5.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]