diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-01-11 12:25:15 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-01-11 12:25:43 +0100 |
commit | bf24996d891966454b3395ab965b87c033b21d7d (patch) | |
tree | 76fd5567a23fb0b3b3db6f1841a926fed4a6b867 /ext2fs | |
parent | d580a97c6c8a1e1419cc7c21f6dd9d1d12b79f92 (diff) | |
download | hurd-bf24996d891966454b3395ab965b87c033b21d7d.tar.gz hurd-bf24996d891966454b3395ab965b87c033b21d7d.tar.bz2 hurd-bf24996d891966454b3395ab965b87c033b21d7d.zip |
libdiskfs: catch mmap failure
Just backtrace for now
Diffstat (limited to 'ext2fs')
-rw-r--r-- | ext2fs/dir.c | 5 | ||||
-rw-r--r-- | ext2fs/hyper.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ext2fs/dir.c b/ext2fs/dir.c index faed301e..256f3d36 100644 --- a/ext2fs/dir.c +++ b/ext2fs/dir.c @@ -965,7 +965,10 @@ diskfs_get_directs (struct node *dp, allocsize = round_page (bufsiz); if (allocsize > *datacnt) - *data = mmap (0, allocsize, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + { + *data = mmap (0, allocsize, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + assert_backtrace (*data != MAP_FAILED); + } /* Set bufp appropriately */ bufp = buf; diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index 82b06d17..d2440dc0 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -46,7 +46,7 @@ allocate_mod_map (void) mod_map_size = le32toh (sblock->s_blocks_count) >> 3; modified_global_blocks = mmap (0, mod_map_size, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); - assert_backtrace (modified_global_blocks != (void *) -1); + assert_backtrace (modified_global_blocks != MAP_FAILED); } else modified_global_blocks = 0; |