diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-04-19 22:24:40 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-04-19 22:44:49 +0200 |
commit | 8c4b37178c8e7cfcbb37682180c697cb6e55cb34 (patch) | |
tree | 314d261e82bce7ec96ec26cab00e9375b6fc7979 /ext2fs/inode.c | |
parent | f564f46dad5ccdcb87c7b56d0c58e9afe4ff49f3 (diff) |
libdiskfs: Fix catching exceptionsv0.9.git20250420
This fixes making diskfs_catch_exception recursive, catching the last
fault exception, and fixes callers.
Diffstat (limited to 'ext2fs/inode.c')
-rw-r--r-- | ext2fs/inode.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/ext2fs/inode.c b/ext2fs/inode.c index a23baee7..dc309ac8 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -634,7 +634,10 @@ diskfs_set_translator (struct node *np, const char *name, mach_msg_type_number_t char buf[block_size]; if (namelen + 2 > block_size) - return ENAMETOOLONG; + { + diskfs_end_catch_exception (); + return ENAMETOOLONG; + } di = dino_ref (np->cache_id); blkno = le32toh (di->i_translator); @@ -650,7 +653,10 @@ diskfs_set_translator (struct node *np, const char *name, mach_msg_type_number_t newmode = (np->dn_stat.st_mode & ~S_IFMT) | S_IFREG; err = diskfs_validate_mode_change (np, newmode); if (err) - return err; + { + diskfs_end_catch_exception (); + return err; + } } /* Allocate block for translator */ @@ -712,7 +718,10 @@ diskfs_set_translator (struct node *np, const char *name, mach_msg_type_number_t } } else - return EOPNOTSUPP; + { + diskfs_end_catch_exception (); + return EOPNOTSUPP; + } diskfs_end_catch_exception (); @@ -778,7 +787,10 @@ diskfs_get_translator (struct node *np, char **namep, mach_msg_type_number_t *na { err = ext2_get_xattr (np, "gnu.translator", NULL, &datalen); if (err) - return err; + { + diskfs_end_catch_exception (); + return err; + } *namep = malloc (datalen); if (!*namep) @@ -790,6 +802,9 @@ diskfs_get_translator (struct node *np, char **namep, mach_msg_type_number_t *na *namelen = datalen; } + else + diskfs_end_catch_exception (); + return err; } |