mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-23 16:20:00 +00:00
Description:Code optimization
Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: lwx1281857 <linnanmu@h-partners.com>
This commit is contained in:
parent
a77603b3e3
commit
310fe365a5
@ -48,7 +48,7 @@ private:
|
||||
return deathRecipient_;
|
||||
}
|
||||
|
||||
static const int DEVICEINFO_LOAD_SA_TIMEOUT_MS = 60000;
|
||||
static const int DEVICEINFO_LOAD_SA_TIMEOUT_MS = 5000;
|
||||
void LoadDeviceInfoSa(std::unique_lock<std::mutex> &lock);
|
||||
sptr<IDeviceInfo> GetService(std::unique_lock<std::mutex> &lock);
|
||||
std::mutex lock_;
|
||||
|
@ -67,8 +67,8 @@ typedef enum {
|
||||
ACTION_SANDBOX = 0,
|
||||
ACTION_DUMP,
|
||||
ACTION_MODULEMGR,
|
||||
ACTION_APP_SANDBOX,
|
||||
ACTION_APP_SPAWNTIME,
|
||||
ACTION_APP_SANDBOX,
|
||||
ACTION_MAX
|
||||
} ActionType;
|
||||
|
||||
|
@ -219,7 +219,7 @@ int MountOverlayOne(const char *mnt)
|
||||
|
||||
int RemountOverlay(void)
|
||||
{
|
||||
char *remountPath[] = { "/usr", "/vendor", "/sys_prod", "/chip_prod", "/preload", "/cust" };
|
||||
char *remountPath[] = { "/usr", "/vendor", "/sys_prod", "/chip_prod", "/preload", "/cust", "/version" };
|
||||
for (size_t i = 0; i < ARRAY_LENGTH(remountPath); i++) {
|
||||
struct stat statInfo;
|
||||
char dirMnt[MAX_BUFFER_LEN] = {0};
|
||||
|
@ -17,6 +17,7 @@
|
||||
#define EROFS_OVERLAY_COMMON_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "fs_manager/ext4_super_block.h"
|
||||
#include "fs_manager/erofs_super_block.h"
|
||||
|
||||
|
@ -124,7 +124,7 @@ static int FormatExt4(const char *fsBlkDev, const char *fsMntPoint)
|
||||
if (ret) {
|
||||
INIT_LOGE("e2fsdroid failed returned %d", ret);
|
||||
}
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void OverlayRemountPre(const char *mnt)
|
||||
|
@ -49,7 +49,8 @@ static int SendAppspawnCmdMessage(const CmdAgent *agent, uint16_t type, const ch
|
||||
BEGET_ERROR_CHECK(ret == 0, return -1, "AppSpawnClientInit error, errno = %d", errno);
|
||||
AppSpawnReqMsgHandle reqHandle;
|
||||
ret = AppSpawnReqMsgCreate(MSG_DUMP, ptyName, &reqHandle);
|
||||
BEGET_ERROR_CHECK(ret == 0, AppSpawnClientDestroy(clientHandle); return -1, "AppSpawnReqMsgCreate error");
|
||||
BEGET_ERROR_CHECK(ret == 0, AppSpawnClientDestroy(clientHandle);
|
||||
return -1, "AppSpawnReqMsgCreate error");
|
||||
ret = AppSpawnReqMsgAddStringInfo(reqHandle, "pty-name", ptyName);
|
||||
BEGET_ERROR_CHECK(ret == 0, AppSpawnClientDestroy(clientHandle);
|
||||
return -1, "add %s request message error", ptyName);
|
||||
|
@ -26,11 +26,11 @@
|
||||
#include <sched.h>
|
||||
|
||||
#include "begetctl.h"
|
||||
#include "init_param.h"
|
||||
#include "param_manager.h"
|
||||
#include "param_security.h"
|
||||
#include "param_init.h"
|
||||
#include "init_param.h"
|
||||
#include "shell_utils.h"
|
||||
#include "param_init.h"
|
||||
#include "beget_ext.h"
|
||||
#ifdef PARAM_SUPPORT_SELINUX
|
||||
#include <policycoreutils.h>
|
||||
|
@ -92,7 +92,7 @@ extern "C" {
|
||||
#endif
|
||||
#define PARAM_WORKSPACE_SMALL (1024 * 10)
|
||||
#define PARAM_WORKSPACE_DEF (1024 * 30)
|
||||
#define PARAM_WORKSPACE_DAC (1024 * 60)
|
||||
#define PARAM_WORKSPACE_DAC (1024 * 1024 * 2)
|
||||
#endif // __LITEOS_A__
|
||||
#endif // __LITEOS_M__
|
||||
#endif // STARTUP_INIT_TEST
|
||||
|
@ -330,7 +330,7 @@ static int LoadParamFromImport_(char *buffer, const int buffSize, uint32_t mode)
|
||||
}
|
||||
char *target = calloc(PATH_MAX, 1);
|
||||
PARAM_CHECK(target != NULL, return -1, "Failed to alloc memory");
|
||||
if (strncpy_s(target, buffSize, buffer + IMPORT_PREFIX_LEN + spaceCount, buffSize) != 0) {
|
||||
if (strncpy_s(target, PATH_MAX, buffer + IMPORT_PREFIX_LEN + spaceCount, buffSize) != 0) {
|
||||
PARAM_LOGE("Failed to get value of import.");
|
||||
free(target);
|
||||
return -1;
|
||||
|
@ -645,6 +645,8 @@ int OpenConsole(void)
|
||||
{
|
||||
#ifndef __LITEOS_M__
|
||||
return OpenStdioDevice("/dev/console", 1);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user