diff options
-rw-r--r-- | fatfs/ChangeLog | 4 | ||||
-rw-r--r-- | fatfs/fat.c | 6 |
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"); |