diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2002-05-28 16:45:28 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2002-05-28 16:45:28 +0000 |
commit | dd9a7192ea4b921b2d0db4d2b21325c521b50718 (patch) | |
tree | a8dbd8effd77ae11da6cc6f04a6a8c5f42aa8b3c /usr.bin | |
parent | 426354710bff0a16ce8153a5bd7b50664b16ffc7 (diff) |
print strerror(errno) on mmap/munmap error; ok markus@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/monitor_mm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/monitor_mm.c b/usr.bin/ssh/monitor_mm.c index b383193cd35..cdd259e02eb 100644 --- a/usr.bin/ssh/monitor_mm.c +++ b/usr.bin/ssh/monitor_mm.c @@ -24,7 +24,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_mm.c,v 1.4 2002/03/25 20:12:10 stevesk Exp $"); +RCSID("$OpenBSD: monitor_mm.c,v 1.5 2002/05/28 16:45:27 stevesk Exp $"); #include <sys/mman.h> @@ -85,7 +85,7 @@ mm_create(struct mm_master *mmalloc, size_t size) address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, 0); if (address == MAP_FAILED) - fatal("mmap(%lu)", (u_long)size); + fatal("mmap(%lu): %s", (u_long)size, strerror(errno)); mm->address = address; mm->size = size; @@ -124,7 +124,8 @@ mm_destroy(struct mm_master *mm) mm_freelist(mm->mmalloc, &mm->rb_allocated); if (munmap(mm->address, mm->size) == -1) - fatal("munmap(%p, %lu)", mm->address, (u_long)mm->size); + fatal("munmap(%p, %lu): %s", mm->address, (u_long)mm->size, + strerror(errno)); if (mm->mmalloc == NULL) xfree(mm); else |