mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Merge branch 'bug31570_041' into maint-0.4.1
This commit is contained in:
commit
c6f7943269
5
changes/bug31570
Normal file
5
changes/bug31570
Normal file
@ -0,0 +1,5 @@
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user