X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fupload.c;h=a1a37aee85fd7d10141c4c18b89d32904ae790b1;hb=477c437ba0e2108413fe2b54a830b36c251242f3;hp=f8d312ffb65a778f652aad50ec8acec95cac06b1;hpb=33b638109ed66ea360b53b80b1f407b3a5f5ec39;p=libguestfs.git diff --git a/daemon/upload.c b/daemon/upload.c index f8d312f..a1a37ae 100644 --- a/daemon/upload.c +++ b/daemon/upload.c @@ -94,16 +94,15 @@ upload (const char *filename, int flags, int64_t offset) 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"); close (data.fd); - /* Do NOT send any error. */ return -1; } 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; }