jcs
/amend
/amendments
/194
bile: Set a useful error code when opening fails due to a bad map
jcs made amendment 194 18 days ago
--- bile.c Sun Oct 4 00:41:47 2026
+++ bile.c Sun Oct 4 11:42:14 2026
@@ -177,14 +177,16 @@ bile_open(const Str255 filename, short vrefnum)
goto open_bail;
if (_bile_open_ignore_primary_map) {
- if (!bile->old_map_ptr.size)
+ if (!bile->old_map_ptr.size) {
+ _bile_error = BILE_ERR_BAD_MAP;
goto open_bail;
+ }
bile->map_ptr = bile->old_map_ptr;
}
if (bile->map_ptr.size) {
if (bile_read_map(bile, &bile->map_ptr) != 0) {
- warn("bile_open: Failed reading map");
+ _bile_error = BILE_ERR_BAD_MAP;
goto open_bail;
}
}
--- bile.h Sun Oct 4 00:36:47 2026
+++ bile.h Sun Oct 4 11:41:29 2026
@@ -76,6 +76,7 @@ struct bile_object {
#define BILE_ERR_NEED_UPGRADE_1 -4000
#define BILE_ERR_BOGUS_OBJECT -4001
+#define BILE_ERR_BAD_MAP -4002
struct bile_highest_id {
OSType type;