From 34083d996bddfa405496482771e26dbc798fb318 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Tue, 3 Oct 2017 16:10:20 +0300 Subject: [PATCH] preload cef library --- HtmlFile/HtmlFile.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/HtmlFile/HtmlFile.cpp b/HtmlFile/HtmlFile.cpp index 58b6ad11a9..e018248d7a 100644 --- a/HtmlFile/HtmlFile.cpp +++ b/HtmlFile/HtmlFile.cpp @@ -391,10 +391,11 @@ int CHtmlFile::Convert(const std::vector& arFiles, const std::wstr nargs[0] = sXmlA.c_str(); nargs[1] = NULL; - const char* nenv[3]; + const char* nenv[4]; nenv[0] = sLibraryDir.c_str(); - nenv[1] = "DISPLAY=:0"; - nenv[2] = NULL; + nenv[1] = "LD_PRELOAD=./libcef.so"; + nenv[2] = "DISPLAY=:0"; + nenv[3] = NULL; execve(sProgramm.c_str(), (char * const *)nargs, @@ -411,10 +412,11 @@ int CHtmlFile::Convert(const std::vector& arFiles, const std::wstr nargs[4] = sXmlA.c_str(); nargs[5] = NULL; - const char* nenv[3]; + const char* nenv[4]; nenv[0] = sLibraryDir.c_str(); - nenv[1] = NULL;//"DISPLAY=:99"; - nenv[2] = NULL; + nenv[1] = "LD_PRELOAD=./libcef.so"; + nenv[2] = NULL;//"DISPLAY=:99"; + nenv[3] = NULL; execve("/usr/bin/xvfb-run", (char * const *)nargs, (char * const *)nenv); exit(EXIT_SUCCESS);