/* Write out the free map now that we have space reserved
for it. */
- file_open (&free_map_file, FREE_MAP_SECTOR);
+ if (!file_open (&free_map_file, FREE_MAP_SECTOR))
+ panic ("can't open free map file");
bitmap_write (&free_map, &free_map_file);
bitmap_destroy (&free_map);
file_close (&free_map_file);
if (format)
do_format ();
- file_open (&free_map_file, FREE_MAP_SECTOR);
- file_open (&root_dir_file, ROOT_DIR_SECTOR);
+ if (!file_open (&free_map_file, FREE_MAP_SECTOR))
+ panic ("can't open free map file");
+ if (!file_open (&root_dir_file, ROOT_DIR_SECTOR))
+ panic ("can't open root dir file");
}
bool
bool success = false;
/* Read the root directory. */
- dir_init (&dir, NUM_DIR_ENTRIES);
+ if (!dir_init (&dir, NUM_DIR_ENTRIES))
+ return false;
dir_read (&dir, &root_dir_file);
if (dir_lookup (&dir, name, NULL))
goto exit1;
disk_sector_no hdr_sector;
bool success = false;
- dir_init (&dir, NUM_DIR_ENTRIES);
+ if (!dir_init (&dir, NUM_DIR_ENTRIES))
+ return false;
dir_read (&dir, &root_dir_file);
if (dir_lookup (&dir, name, &hdr_sector))
success = file_open (file, hdr_sector);
bool success = false;
/* Read the root directory. */
- dir_init (&dir, NUM_DIR_ENTRIES);
+ if (!dir_init (&dir, NUM_DIR_ENTRIES))
+ return false;
dir_read (&dir, &root_dir_file);
if (!dir_lookup (&dir, name, &hdr_sector))
goto exit1;