mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user