!43 FIx library loader micro

Merge pull request !43 from guozejun/cherry-pick-1632720812
This commit is contained in:
openharmony_ci 2021-09-27 09:19:16 +00:00 committed by Gitee
commit 48047dbe8c
3 changed files with 5 additions and 11 deletions

View File

@ -143,12 +143,7 @@ private:
*/
bool CheckAppProperty(const ClientSocket::AppProperty *appProperty);
#ifdef ACEABILITY_LIBRARY_LOADER
/**
* Load libace.z.so library when boot the devices
*/
void LoadAceLib();
#endif
private:
const std::string deviceNull_ = "/dev/null";

View File

@ -28,10 +28,8 @@
#include "main_thread.h"
#include "securec.h"
#if defined(ABILITY_LIBRARY_LOADER) || defined(APPLICATION_LIBRARY_LOADER)
#include <dirent.h>
#include <dlfcn.h>
#endif
#define GRAPHIC_PERMISSION_CHECK
constexpr static size_t ERR_STRING_SZ = 64;
@ -159,7 +157,6 @@ void AppSpawnServer::ConnectionPeer()
}
}
#ifdef ACEABILITY_LIBRARY_LOADER
void AppSpawnServer::LoadAceLib()
{
std::string acelibdir("/system/lib/libace.z.so");
@ -173,7 +170,6 @@ void AppSpawnServer::LoadAceLib()
}
HiLog::Info(LABEL, "MainThread::LoadAbilityLibrary. End calling dlopen.");
}
#endif
bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen)
{
@ -182,9 +178,9 @@ bool AppSpawnServer::ServerMain(char *longProcName, int64_t longProcNameLen)
return false;
}
std::thread(&AppSpawnServer::ConnectionPeer, this).detach();
#ifdef ACEABILITY_LIBRARY_LOADER
LoadAceLib();
#endif
while (isRunning_) {
std::unique_lock<std::mutex> lock(mut_);
dataCond_.wait(lock, [this] { return !this->appQueue_.empty(); });

View File

@ -24,6 +24,9 @@
#undef private
#undef protected
#include <dirent.h>
#include <dlfcn.h>
using namespace testing;
using namespace testing::ext;
using namespace OHOS::AppSpawn;