Mercurial > dovecot > core-2.2
changeset 9487:a33722839adf 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:11 -0400 |
parents | a04a3ce0764e |
children | 1492d688d8a9 |
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 18:48:14 2009 -0400 +++ b/src/util/threadview.c Tue Jun 16 18:55:11 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;