diff options
Diffstat (limited to 'src/testdevinfo.c')
-rw-r--r-- | src/testdevinfo.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/testdevinfo.c b/src/testdevinfo.c index 9c555ed..5c3f600 100644 --- a/src/testdevinfo.c +++ b/src/testdevinfo.c @@ -32,7 +32,7 @@ int main(int argc, char **argv) return 1; } - fd = open(argv[1], O_RDONLY); + fd = open(argv[1], O_RDONLY | O_NONBLOCK); if (fd < 0) { perror("open device"); return 1; @@ -42,7 +42,7 @@ int main(int argc, char **argv) get_device_info(fd, &info); close(fd); - printf("\nfound information:\n"); + printf("found information:\n"); printf("device type: "); switch (info.type) { @@ -107,7 +107,13 @@ int main(int argc, char **argv) if (info.geom_start < 0) printf("unknown\n"); else - printf("%ld\n", info.geom_start); + printf("%lld\n", info.geom_start); + + printf("total disk sectors: "); + if (info.geom_size < 0) + printf("unknown\n"); + else + printf("%lld\n", info.geom_size); printf("sector size: "); if (info.sector_size < 0) |