diff options
author | relan <relan@users.noreply.github.com> | 2012-03-03 07:39:07 +0000 |
---|---|---|
committer | relan <relan@users.noreply.github.com> | 2015-08-24 08:26:14 +0300 |
commit | ad3c8453f7dd16d72bc6bae55b516bf27068b63d (patch) | |
tree | b525d24bb2b95e4d00b67762b3a38ecc4abe003e /dump | |
parent | 9d3278dbfa14e58e4e734d5e1bdbc61490151d28 (diff) | |
download | android_external_exfat-ad3c8453f7dd16d72bc6bae55b516bf27068b63d.tar.gz android_external_exfat-ad3c8453f7dd16d72bc6bae55b516bf27068b63d.tar.bz2 android_external_exfat-ad3c8453f7dd16d72bc6bae55b516bf27068b63d.zip |
Represent device as an extensible structure.
Diffstat (limited to 'dump')
-rw-r--r-- | dump/main.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/dump/main.c b/dump/main.c index c44d23c..cd424d9 100644 --- a/dump/main.c +++ b/dump/main.c @@ -73,22 +73,22 @@ static void print_other_info(const struct exfat_super_block* sb) static int dump_sb(const char* spec) { - int fd; + struct exfat_dev* dev; struct exfat_super_block sb; - fd = exfat_open(spec, 1); - if (fd < 0) + dev = exfat_open(spec, 1); + if (dev == NULL) return 1; - if (exfat_read(fd, &sb, sizeof(struct exfat_super_block)) < 0) + if (exfat_read(dev, &sb, sizeof(struct exfat_super_block)) < 0) { - exfat_close(fd); + exfat_close(dev); exfat_error("failed to read from `%s'", spec); return 1; } if (memcmp(sb.oem_name, "EXFAT ", sizeof(sb.oem_name)) != 0) { - exfat_close(fd); + exfat_close(dev); exfat_error("exFAT file system is not found on `%s'", spec); return 1; } @@ -98,7 +98,7 @@ static int dump_sb(const char* spec) print_cluster_info(&sb); print_other_info(&sb); - exfat_close(fd); + exfat_close(dev); return 0; } |