X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Fexfat-utils.git;a=blobdiff_plain;f=dump%2Fmain.c;h=1536f81231bc10dd7b91cd03ff4f0e47d4da4435;hp=357557d6ee2af4dfa0a4dda46f85d1b9d835c42f;hb=70a4b10edcf53a90140e6dd80ccaa045f3647ad7;hpb=4cb393cfd9b0ab69392612521ee3dbe481ec492d

diff --git a/dump/main.c b/dump/main.c
index 357557d..1536f81 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -2,7 +2,7 @@
 	main.c (08.11.10)
 	Prints detailed information about exFAT volume.
 
-	Copyright (C) 2010  Andrew Nayenko
+	Copyright (C) 2011, 2012  Andrew Nayenko
 
 	This program is free software: you can redistribute it and/or modify
 	it under the terms of the GNU General Public License as published by
@@ -73,23 +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 (read(fd, &sb, sizeof(struct exfat_super_block))
-			!= sizeof(struct exfat_super_block))
+	if (exfat_read(dev, &sb, sizeof(struct exfat_super_block)) < 0)
 	{
-		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)
 	{
-		close(fd);
+		exfat_close(dev);
 		exfat_error("exFAT file system is not found on `%s'", spec);
 		return 1;
 	}
@@ -99,7 +98,7 @@ static int dump_sb(const char* spec)
 	print_cluster_info(&sb);
 	print_other_info(&sb);
 
-	close(fd);
+	exfat_close(dev);
 	return 0;
 }
 
@@ -163,7 +162,7 @@ int main(int argc, char* argv[])
 			used_sectors = 1;
 		else if (strcmp(*pp, "-v") == 0)
 		{
-			puts("Copyright (C) 2010  Andrew Nayenko");
+			puts("Copyright (C) 2011, 2012  Andrew Nayenko");
 			return 0;
 		}
 		else if (spec == NULL)