dovecot-2.0: threadview: If mmap() fails, fail with an error ins...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Jun 17 01:55:16 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/a33722839adf
changeset: 9487:a33722839adf
user: Timo Sirainen <tss at iki.fi>
date: Tue Jun 16 18:55:11 2009 -0400
description:
threadview: If mmap() fails, fail with an error instead of crashing.
diffstat:
1 file changed, 2 insertions(+)
src/util/threadview.c | 2 ++
diffs (12 lines):
diff -r a04a3ce0764e -r a33722839adf src/util/threadview.c
--- 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 @@ int main(int argc, const char *argv[])
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;
More information about the dovecot-cvs
mailing list