summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9b49a9c934a6..f1ca1291aed0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -31,8 +31,10 @@
#undef HAVE_MALLOC_TRIM
+#ifdef UNX
+# include <fcntl.h>
+#endif
#ifdef LINUX
-#include <fcntl.h>
#if defined __GLIBC__
# include <malloc.h>
# define HAVE_MALLOC_TRIM
@@ -234,6 +236,20 @@ using namespace bridge;
using namespace uno;
using namespace lang;
+#ifdef UNX
+
+static int urandom = -1;
+
+extern "C" {
+ int SAL_JNI_EXPORT lok_open_urandom()
+ {
+ return dup(urandom);
+ }
+};
+
+#endif
+
+
using LanguageToolCfg = officecfg::Office::Linguistic::GrammarChecking::LanguageTool;
static LibLibreOffice_Impl *gImpl = nullptr;
@@ -7903,6 +7919,10 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
const char* tz = ::getenv("TZ");
SfxLokHelper::setDefaultTimezone(!!tz, tz ? OStringToOUString(tz, RTL_TEXTENCODING_UTF8)
: OUString());
+#ifdef UNX
+ if (urandom < 0)
+ urandom = open("/dev/urandom", O_RDONLY);
+#endif
}
if (eStage != SECOND_INIT)