From c5b4d18cc640368468b5720d2520fd89ab819260 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 4 Aug 2003 22:26:14 +0000 Subject: 2003-08-05 Marcus Brinkmann * fat.c (fat_read_sblock): Catch error from store_read. --- fatfs/ChangeLog | 4 ++++ fatfs/fat.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'fatfs') 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 + + * fat.c (fat_read_sblock): Catch error from store_read. + 2003-08-03 Marco Gerards * 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"); -- cgit v1.2.3