From 105ccbe192391735f499d31207618757c37426e2 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Thu, 6 Jun 2002 20:33:06 +0000 Subject: [PATCH] - stevesk@cvs.openbsd.org 2002/05/28 16:45:27 [monitor_mm.c] print strerror(errno) on mmap/munmap error; ok markus@ --- ChangeLog | 5 ++++- monitor_mm.c | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 943f6870c..a9bf773d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,9 @@ - stevesk@cvs.openbsd.org 2002/05/26 20:35:10 [ssh.1] sort ChallengeResponseAuthentication; ok markus@ + - stevesk@cvs.openbsd.org 2002/05/28 16:45:27 + [monitor_mm.c] + print strerror(errno) on mmap/munmap error; ok markus@ 20020604 - (stevesk) [channels.c] bug #164 patch from YOSHIFUJI Hideaki (changed @@ -722,4 +725,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2154 2002/06/06 20:30:28 mouring Exp $ +$Id: ChangeLog,v 1.2155 2002/06/06 20:33:06 mouring Exp $ diff --git a/monitor_mm.c b/monitor_mm.c index 993925e48..17b319cce 100644 --- a/monitor_mm.c +++ b/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 $"); #ifdef HAVE_SYS_MMAN_H #include @@ -88,7 +88,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(errnor)); #else fatal("%s: UsePrivilegeSeparation=yes not supported", __FUNCTION__); @@ -132,7 +132,8 @@ mm_destroy(struct mm_master *mm) #ifdef HAVE_MMAP 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)); #else fatal("%s: UsePrivilegeSeparation=yes not supported", __FUNCTION__);