Update TODO.
[libguestfs.git] / daemon / tar.c
index 3c756af..74d7b05 100644 (file)
@@ -118,14 +118,15 @@ do_tXz_in (const char *dir, const char *filter)
     return -1;
   }
   if (r == -2) {               /* cancellation from library */
+    /* This error is ignored by the library since it initiated the
+     * cancel.  Nevertheless we must send an error reply here.
+     */
+    reply_with_error ("file upload cancelled");
     pclose (fp);
-    /* Do NOT send any error. */
     return -1;
   }
 
   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);