git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix 'unknown filesystem' warnings in old inspection code (RHBZ#678231 RHBZ#666578).
[libguestfs.git]
/
daemon
/
upload.c
diff --git
a/daemon/upload.c
b/daemon/upload.c
index
e28bf96
..
a1a37ae
100644
(file)
--- a/
daemon/upload.c
+++ b/
daemon/upload.c
@@
-70,7
+70,7
@@
upload (const char *filename, int flags, int64_t offset)
err = errno;
r = cancel_receive ();
errno = err;
err = errno;
r = cancel_receive ();
errno = err;
-
if (r != -2)
reply_with_perror ("%s", filename);
+ reply_with_perror ("%s", filename);
return -1;
}
return -1;
}
@@
-79,7
+79,7
@@
upload (const char *filename, int flags, int64_t offset)
err = errno;
r = cancel_receive ();
errno = err;
err = errno;
r = cancel_receive ();
errno = err;
-
if (r != -2)
reply_with_perror ("lseek: %s", filename);
+ reply_with_perror ("lseek: %s", filename);
return -1;
}
}
return -1;
}
}
@@
-89,23
+89,21
@@
upload (const char *filename, int flags, int64_t offset)
err = errno;
r = cancel_receive ();
errno = err;
err = errno;
r = cancel_receive ();
errno = err;
-
if (r != -2)
reply_with_error ("write error: %s", filename);
+ reply_with_error ("write error: %s", filename);
close (data.fd);
return -1;
}
if (r == -2) { /* cancellation from library */
close (data.fd);
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);
close (data.fd);
- /* Do NOT send any error. */
return -1;
}
if (close (data.fd) == -1) {
return -1;
}
if (close (data.fd) == -1) {
- err = errno;
- if (r == -1) /* if r == 0, file transfer ended already */
- r = cancel_receive ();
- errno = err;
- if (r != -2)
- reply_with_perror ("close: %s", filename);
+ reply_with_perror ("close: %s", filename);
return -1;
}
return -1;
}