X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=vmtar.c;h=29160b8208dd0b14eec828853fe0e85e405fa774;hb=refs%2Fheads%2Fstable2.0-fixes;hp=b1d84841a201103b6c4f7a60f3d6675e90804c8b;hpb=15fa30e3ec02790c3a8511ec55774fdb9f47153c;p=qemu-server.git diff --git a/vmtar.c b/vmtar.c index b1d8484..29160b8 100644 --- a/vmtar.c +++ b/vmtar.c @@ -402,7 +402,7 @@ dump_sparse_file (int fd, struct writebuffer *wbuf, struct sp_array *ma) while (bytes_left > 0) { size_t bufsize = (bytes_left > BLOCKSIZE) ? BLOCKSIZE : bytes_left; - size_t bytes_read; + ssize_t bytes_read; char *blkbuf = buffer_block (wbuf); if ((bytes_read = full_read (fd, blkbuf, bufsize)) < 0) { @@ -530,7 +530,7 @@ main (int argc, char **argv) time_t ctime = fs.st_mtime; struct sp_array *ma = sparray_new(); - if (sparse) { + if (sparse && !S_ISBLK(fs.st_mode)) { if (!scan_sparse_file (fd, ma)) { fprintf (stderr, "scanning '%s' failed\n", source); exit (-1);