Skip to content
Snippets Groups Projects
Commit c6f79432 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Merge branch 'bug31570_041' into maint-0.4.1

parents 50f98171 52342327
No related branches found
No related tags found
No related merge requests found
o Major bugfixes (crash, android):
- Tolerate systems (including some Android installations) where madvise
and MADV_DONTDUMP are available at build-time, but not at run time.
Previously, these systems would notice a failed syscall and abort.
Fixes bug 31570; bugfix on 0.4.1.1-alpha.
......@@ -111,7 +111,17 @@ static int
nodump_mem(void *mem, size_t sz)
{
#if defined(MADV_DONTDUMP)
return madvise(mem, sz, MADV_DONTDUMP);
int rv = madvise(mem, sz, MADV_DONTDUMP);
if (rv == 0) {
return 0;
} else if (errno == ENOSYS || errno == EINVAL) {
return 0; // syscall not supported, or flag not supported.
} else {
tor_log_err_sigsafe("Unexpected error from madvise: ",
strerror(errno),
NULL);
return -1;
}
#else
(void) mem;
(void) sz;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment