preload cef library

This commit is contained in:
Oleg Korshul
2017-10-03 16:10:20 +03:00
parent ef96571879
commit 34083d996b

View File

@ -391,10 +391,11 @@ int CHtmlFile::Convert(const std::vector<std::wstring>& 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<std::wstring>& 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);