summaryrefslogtreecommitdiffstats
path: root/daemon/upload.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-04-07 21:04:01 +0100
committerRichard Jones <rjones@redhat.com>2010-04-08 09:41:57 +0100
commitde7ef2a0fdcbcddfd35ecb8ee2804e1ca0968454 (patch)
tree773bf6593bdf267b6e9437bfd8d2ccc24646db09 /daemon/upload.c
parent07f4b20ae959069fca41756b0dc103ec5fa99754 (diff)
downloadlibguestfs-de7ef2a0fdcbcddfd35ecb8ee2804e1ca0968454.tar.gz
libguestfs-de7ef2a0fdcbcddfd35ecb8ee2804e1ca0968454.tar.xz
libguestfs-de7ef2a0fdcbcddfd35ecb8ee2804e1ca0968454.zip
Code cleanups related to RHBZ#580246.
This includes various code cleanups: (a) A regression test for RHBZ#580246. (b) Use write instead of fwrite to write out the tar file. This is just because the error handling of write seems to be better specified and easier to use. (c) Use size_t instead of int for length. (d) Clearer debug messages when in verbose mode.
Diffstat (limited to 'daemon/upload.c')
-rw-r--r--daemon/upload.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/daemon/upload.c b/daemon/upload.c
index 65c66675..3c20d6f0 100644
--- a/daemon/upload.c
+++ b/daemon/upload.c
@@ -28,7 +28,7 @@
#include "actions.h"
static int
-write_cb (void *fd_ptr, const void *buf, int len)
+write_cb (void *fd_ptr, const void *buf, size_t len)
{
int fd = *(int *)fd_ptr;
return xwrite (fd, buf, len);
@@ -65,7 +65,7 @@ do_upload (const char *filename)
err = errno;
cancel_receive ();
errno = err;
- reply_with_perror ("write: %s", filename);
+ reply_with_error ("write error: %s", filename);
close (fd);
return -1;
}