Mercurial > dovecot > original-hg > dovecot-1.2
changeset 9140:fd2869cf92fd HEAD
threadview: If mmap() fails, fail with an error instead of crashing.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 16 Jun 2009 18:55:34 -0400 |
parents | 17e87db4e97c |
children | d21bd1a1710a |
files | src/util/threadview.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/util/threadview.c Tue Jun 16 14:41:02 2009 -0400 +++ b/src/util/threadview.c Tue Jun 16 18:55:34 2009 -0400 @@ -163,6 +163,8 @@ max_likely_index = (st.st_size / 8) * 2; map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); + if (map == MAP_FAILED) + i_fatal("mmap() failed: %m"); end = CONST_PTR_OFFSET(map, st.st_size); pos = dump_hdr(map); uid = 0;