use lseek to get size of block devices

This commit is contained in:
Dietmar Maurer 2012-02-08 06:42:14 +01:00
parent a9a94d59f3
commit 15fa30e3ec

View File

@ -536,7 +536,11 @@ main (int argc, char **argv)
exit (-1);
}
} 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);
ma->real_size = file_size;
ma->effective_size = file_size;