mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Merge branch 'tor-github/pr/1318'
This commit is contained in:
commit
bdd17da9fd
5
changes/bug31696
Normal file
5
changes/bug31696
Normal file
@ -0,0 +1,5 @@
|
||||
o Major bugfixes (crash, Linux):
|
||||
- Tolerate systems (including some Linux installations) where madvise
|
||||
and/or MADV_DONTFORK are available at build-time, but not at run time.
|
||||
Previously, these systems would notice a failed syscall and abort.
|
||||
Fixes bug 31696; bugfix on 0.4.1.1-alpha.
|
@ -149,18 +149,33 @@ noinherit_mem(void *mem, size_t sz, inherit_res_t *inherit_result_out)
|
||||
return 0;
|
||||
}
|
||||
#endif /* defined(FLAG_ZERO) */
|
||||
|
||||
#ifdef FLAG_NOINHERIT
|
||||
int r2 = MINHERIT(mem, sz, FLAG_NOINHERIT);
|
||||
if (r2 == 0) {
|
||||
*inherit_result_out = INHERIT_RES_DROP;
|
||||
return 0;
|
||||
}
|
||||
return r2;
|
||||
#else /* !(defined(FLAG_NOINHERIT)) */
|
||||
#endif /* defined(FLAG_NOINHERIT) */
|
||||
|
||||
#if defined(FLAG_ZERO) || defined(FLAG_NOINHERIT)
|
||||
/* At least one operation was tried, and neither succeeded. */
|
||||
|
||||
if (errno == ENOSYS || errno == EINVAL) {
|
||||
/* Syscall not supported, or flag not supported. */
|
||||
return 0;
|
||||
} else {
|
||||
tor_log_err_sigsafe("Unexpected error from minherit: ",
|
||||
strerror(errno),
|
||||
NULL);
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
(void)inherit_result_out;
|
||||
(void)mem;
|
||||
(void)sz;
|
||||
return 0;
|
||||
#endif /* defined(FLAG_NOINHERIT) */
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user