X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fdebug.c;h=0ade2a41b5568cb0b4de2717328eb0c44fe139af;hb=9160eec4fbf12643d8d5fa13465066822b2fed92;hp=b6d9f686de485ad624ae2595c5f0db213486c9b2;hpb=13276f753421c2df4f036647ce43e2ae8a2def0c;p=libguestfs.git diff --git a/daemon/debug.c b/daemon/debug.c index b6d9f68..0ade2a4 100644 --- a/daemon/debug.c +++ b/daemon/debug.c @@ -28,7 +28,7 @@ #include #include -#include "../src/guestfs_protocol.h" +#include "guestfs_protocol.h" #include "daemon.h" #include "actions.h" @@ -540,16 +540,15 @@ do_debug_upload (const char *filename, int mode) 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 (fd); - /* Do NOT send any error. */ return -1; } 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; }