From: Richard W.M. Jones Date: Wed, 8 Jun 2011 20:53:07 +0000 (+0100) Subject: Coverity: Remove unreachable code. X-Git-Tag: 1.8.8~13 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=20f8e7c6b5f6d4bcd30d64f8fdba26ff1e3dca38;p=libguestfs.git Coverity: Remove unreachable code. (cherry picked from commit 9160eec4fbf12643d8d5fa13465066822b2fed92) --- 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; }