summaryrefslogtreecommitdiff
path: root/fatfs
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2003-08-04 22:26:14 +0000
committerMarcus Brinkmann <marcus@gnu.org>2003-08-04 22:26:14 +0000
commitc5b4d18cc640368468b5720d2520fd89ab819260 (patch)
tree86df4afa7e55d9d2445ef76a26d7ecaa737c851a /fatfs
parente1821a4d29562acfd4b4f19700d67151fda73796 (diff)
2003-08-05 Marcus Brinkmann <marcus@gnu.org>
* fat.c (fat_read_sblock): Catch error from store_read.
Diffstat (limited to 'fatfs')
-rw-r--r--fatfs/ChangeLog4
-rw-r--r--fatfs/fat.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/fatfs/ChangeLog b/fatfs/ChangeLog
index 09e85fcb..63c9fcb4 100644
--- a/fatfs/ChangeLog
+++ b/fatfs/ChangeLog
@@ -1,3 +1,7 @@
+2003-08-05 Marcus Brinkmann <marcus@gnu.org>
+
+ * fat.c (fat_read_sblock): Catch error from store_read.
+
2003-08-03 Marco Gerards <metgerards@student.han.nl>
* inode.c (read_node): Fix typo.
diff --git a/fatfs/fat.c b/fatfs/fat.c
index 86fe908e..1d110c40 100644
--- a/fatfs/fat.c
+++ b/fatfs/fat.c
@@ -68,10 +68,14 @@ cluster_t next_free_cluster = 2;
void
fat_read_sblock (void)
{
+ error_t err;
int read;
sblock = malloc (sizeof (struct boot_sector));
- store_read (store, 0, sizeof (struct boot_sector), (void **) &sblock, &read);
+ err = store_read (store, 0, sizeof (struct boot_sector),
+ (void **) &sblock, &read);
+ if (err)
+ error (1, err, "Could not read superblock");
if (read_word(sblock->id) != BOOT_SECTOR_ID)
error (1, 0, "Could not find valid superblock");