summaryrefslogtreecommitdiff
path: root/libdiskfs/disk-pager.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-19 22:24:40 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-04-19 22:44:49 +0200
commit8c4b37178c8e7cfcbb37682180c697cb6e55cb34 (patch)
tree314d261e82bce7ec96ec26cab00e9375b6fc7979 /libdiskfs/disk-pager.c
parentf564f46dad5ccdcb87c7b56d0c58e9afe4ff49f3 (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 'libdiskfs/disk-pager.c')
-rw-r--r--libdiskfs/disk-pager.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c
index 7af0e3ba..886ce157 100644
--- a/libdiskfs/disk-pager.c
+++ b/libdiskfs/disk-pager.c
@@ -84,6 +84,7 @@ diskfs_start_disk_pager (struct user_pager_info *upi,
static void
fault_handler (int sig, long int sigcode, struct sigcontext *scp)
{
+ jmp_buf *env;
error_t err;
#ifndef NDEBUG
@@ -102,8 +103,10 @@ fault_handler (int sig, long int sigcode, struct sigcontext *scp)
}
#endif
+ env = &diskfs_exception_diu->env;
+
/* Clear the record, since the faulting thread will not. */
- diskfs_exception_diu = NULL;
+ diskfs_exception_diu = diskfs_exception_diu->next;
/* Fetch the error code from the pager. */
assert_backtrace (scp->sc_error == EKERN_MEMORY_ERROR);
@@ -111,5 +114,5 @@ fault_handler (int sig, long int sigcode, struct sigcontext *scp)
assert_backtrace (err);
/* Make `diskfault_catch' return the error code. */
- longjmp (diskfs_exception_diu->env, err);
+ longjmp (*env, err);
}