diff options
author | TizenOpenSource <tizenopensrc@samsung.com> | 2022-12-26 17:25:57 +0900 |
---|---|---|
committer | TizenOpenSource <tizenopensrc@samsung.com> | 2022-12-26 17:25:57 +0900 |
commit | 37a0f909140771bb9fec3d6d13ff5680166b390f (patch) | |
tree | 5e6fee1a628c59c293d0c085c40e9acf581bdde5 /src/testdevinfo.c | |
parent | 8fdf19c265dfb44d1fc16dd1aed612d9a29fe5dc (diff) | |
download | dosfstools-upstream.tar.gz dosfstools-upstream.tar.bz2 dosfstools-upstream.zip |
Imported Upstream version 4.2upstream/4.2upstream
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) |