aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-05-30 09:56:18 -0400
committerDavid Goulet <dgoulet@torproject.org>2019-05-30 09:56:18 -0400
commit61bd8f428b2bd637591dace2d7d65af42740b898 (patch)
tree03b00376f6fa6321781fc121179164a47a656385
parent70553a91343e242e05e569d59584674a21d09679 (diff)
parentbdf685e47614ef5dca935b9fe9a608ffdd63a816 (diff)
downloadtor-61bd8f428b2bd637591dace2d7d65af42740b898.tar.gz
tor-61bd8f428b2bd637591dace2d7d65af42740b898.zip
Merge branch 'tor-github/pr/1049'
-rw-r--r--changes/bug306144
-rw-r--r--src/lib/malloc/map_anon.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/changes/bug30614 b/changes/bug30614
new file mode 100644
index 0000000000..9f904bd115
--- /dev/null
+++ b/changes/bug30614
@@ -0,0 +1,4 @@
+ o Minor bugfixes (NetBSD):
+ - Fix usage of minherit() on NetBSD and other platforms that define
+ MAP_INHERIT_{ZERO,NONE} instead of INHERIT_{ZERO,NONE}. Fixes bug
+ 30614; bugfix on 0.4.0.2-alpha. Patch from Taylor Campbell.
diff --git a/src/lib/malloc/map_anon.c b/src/lib/malloc/map_anon.c
index f4fda00bff..e2c41ab9c3 100644
--- a/src/lib/malloc/map_anon.c
+++ b/src/lib/malloc/map_anon.c
@@ -50,11 +50,15 @@
#ifdef INHERIT_ZERO
#define FLAG_ZERO INHERIT_ZERO
+#elif defined(MAP_INHERIT_ZERO)
+#define FLAG_ZERO MAP_INHERIT_ZERO
#endif
#ifdef INHERIT_NONE
#define FLAG_NOINHERIT INHERIT_NONE
#elif defined(VM_INHERIT_NONE)
#define FLAG_NOINHERIT VM_INHERIT_NONE
+#elif defined(MAP_INHERIT_NONE)
+#define FLAG_NOINHERIT MAP_INHERIT_NONE
#endif
#elif defined(HAVE_MADVISE)