diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-06 16:44:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-06 18:36:55 +0100 |
commit | cca1240fe5884f184af489f5326e96892d1ae975 (patch) | |
tree | c8af127cd477361d93995346bd96902a35997e03 | |
parent | 9c98bf224d1dc8c5cb91d49273836eeb6111d697 (diff) |
Related tdf#134754: Detect failed mmap on macOS
Change-Id: I21202d25e4851725198c58c29d9820bda00f2b30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107315
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | bridges/source/cpp_uno/shared/vtablefactory.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index 52309c6ec617..73dc42ef6dfc 100644 --- a/bridges/source/cpp_uno/shared/vtablefactory.cxx +++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx @@ -85,6 +85,11 @@ extern "C" void * allocExec( p = mmap( nullptr, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON | MAP_JIT, -1, 0); + if (p == MAP_FAILED) { + auto const e = errno; + SAL_WARN("bridges.osx", "mmap failed with " << e << ", " << strerror(e)); + p = nullptr; + } #else p = mmap( nullptr, n, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, |