#include <string.h>
#include <fcntl.h>
-#include "../src/guestfs_protocol.h"
+#include "guestfs_protocol.h"
#include "daemon.h"
#include "actions.h"
FILE *fp;
char *cmd;
- if (asprintf_nowarn (&cmd, "base64 -d > %R", file) == -1) {
+ if (asprintf_nowarn (&cmd, "base64 -d -i > %R", file) == -1) {
err = errno;
cancel_receive ();
errno = err;
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;
}