mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-15 21:47:05 +00:00
use lseek to get size of block devices
This commit is contained in:
parent
a9a94d59f3
commit
15fa30e3ec
6
vmtar.c
6
vmtar.c
@ -536,7 +536,11 @@ main (int argc, char **argv)
|
|||||||
exit (-1);
|
exit (-1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
off_t file_size = fs.st_size;
|
off_t file_size = lseek(fd, 0, SEEK_END);
|
||||||
|
if (file_size < 0) {
|
||||||
|
fprintf (stderr, "unable to get file size of '%s'\n", source);
|
||||||
|
exit (-1);
|
||||||
|
}
|
||||||
sparray_add (ma, 0, file_size);
|
sparray_add (ma, 0, file_size);
|
||||||
ma->real_size = file_size;
|
ma->real_size = file_size;
|
||||||
ma->effective_size = file_size;
|
ma->effective_size = file_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user