mirror of
https://gitee.com/openharmony/startup_init
synced 2025-02-25 23:15:38 +00:00
iccarm 工具链支持
Signed-off-by: i-wangliangliang <willfox@126.com> Change-Id: I4007881c5bc224d78d0ae8bd09bf70d2bc04c40a
This commit is contained in:
parent
e827e20b54
commit
cc16a30ddc
@ -28,7 +28,6 @@ if (defined(ohos_lite)) {
|
||||
"_GNU_SOURCE",
|
||||
"OHOS_LITE",
|
||||
]
|
||||
cflags = [ "-fPIC" ]
|
||||
public_configs = [ ":exported_header_files" ]
|
||||
|
||||
if (ohos_kernel_type == "linux") {
|
||||
|
@ -129,7 +129,7 @@ INIT_LOCAL_API void InitLog(int logLevel, unsigned int domain, const char *tag,
|
||||
tmpFmt[sizeof(tmpFmt) - 2] = '\n'; // 2 add \n to tail
|
||||
tmpFmt[sizeof(tmpFmt) - 1] = '\0';
|
||||
}
|
||||
PrintLog(logLevel, domain, tag, tmpFmt);
|
||||
PrintLog((InitLogLevel)logLevel, domain, tag, tmpFmt);
|
||||
}
|
||||
|
||||
INIT_PUBLIC_API void SetInitLogLevel(InitLogLevel level)
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "param_manager.h"
|
||||
#include "param_trie.h"
|
||||
|
||||
static ParamWorkSpace g_paramWorkSpace = {};
|
||||
static ParamWorkSpace g_paramWorkSpace = {0};
|
||||
PARAM_STATIC int WorkSpaceNodeCompare(const HashNode *node1, const HashNode *node2)
|
||||
{
|
||||
WorkSpace *workSpace1 = HASHMAP_ENTRY(node1, WorkSpace, hashNode);
|
||||
@ -168,7 +168,7 @@ INIT_INNER_API int InitParamWorkSpace(int onlyRead, const PARAM_WORKSPACE_OPS *o
|
||||
// load user info for dac
|
||||
LoadGroupUser();
|
||||
// add default dac policy
|
||||
ParamAuditData auditData = {};
|
||||
ParamAuditData auditData = {0};
|
||||
auditData.name = "#";
|
||||
auditData.dacData.gid = DAC_DEFAULT_GROUP; // 2000 for shell
|
||||
auditData.dacData.uid = DAC_DEFAULT_USER; // for root
|
||||
|
@ -24,9 +24,11 @@
|
||||
#include "selinux_parameter.h"
|
||||
#else
|
||||
typedef struct ParamContextsList_ {
|
||||
char unused;
|
||||
} ParamContextsList;
|
||||
|
||||
typedef struct SrcInfo {
|
||||
char unused;
|
||||
} SrcInfo;
|
||||
#endif
|
||||
|
||||
|
@ -108,7 +108,6 @@ static_library("param_init_lite") {
|
||||
static_library("param_client_lite") {
|
||||
sources = base_sources
|
||||
include_dirs = param_include_dirs
|
||||
cflags = [ "-fPIC" ]
|
||||
defines = param_build_defines
|
||||
public_configs = [ ":exported_header_files" ]
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
static int g_flags = 0;
|
||||
|
||||
__attribute__((constructor)) static void ClientInit(void);
|
||||
__attribute__((destructor)) static void ClientDeinit(void);
|
||||
static void ClientDeinit(void);
|
||||
|
||||
static int InitParamClient(void)
|
||||
{
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "utils_file.h"
|
||||
|
||||
// for linux, no mutex
|
||||
static ParamMutex g_saveMutex = {};
|
||||
static ParamMutex g_saveMutex = {0};
|
||||
#ifdef PARAM_SUPPORT_POSIX
|
||||
#define MODE_READ O_RDONLY
|
||||
#define MODE_APPEND (O_RDWR | O_CREAT | O_APPEND)
|
||||
|
@ -14,6 +14,7 @@
|
||||
*/
|
||||
#include "param_osadp.h"
|
||||
#include "param_security.h"
|
||||
#include "securec.h"
|
||||
|
||||
static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit)
|
||||
{
|
||||
@ -81,4 +82,4 @@ INIT_LOCAL_API int RegisterSecurityDacOps(ParamSecurityOps *ops, int isInit)
|
||||
|
||||
INIT_LOCAL_API void LoadGroupUser(void)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <sys/shm.h>
|
||||
#else
|
||||
#include "los_task.h"
|
||||
#include "los_mux.h"
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
@ -318,4 +319,4 @@ INIT_LOCAL_API uint32_t Difftime(time_t curr, time_t base)
|
||||
(void)base;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "param_osadp.h"
|
||||
#include "securec.h"
|
||||
|
||||
static ParamPersistWorkSpace g_persistWorkSpace = {0, 0, NULL, 0, {}};
|
||||
static ParamPersistWorkSpace g_persistWorkSpace = {0, 0, NULL, 0, {0}};
|
||||
static int IsNeedToSave(const char *name)
|
||||
{
|
||||
#if defined(__LITEOS_M__) || defined(__LITEOS_A__)
|
||||
@ -241,4 +241,4 @@ int LoadPersistParams(void)
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ char **SplitStringExt(char *buffer, const char *del, int *returnCount, int maxIt
|
||||
void WaitForFile(const char *source, unsigned int maxSecond)
|
||||
{
|
||||
INIT_ERROR_CHECK(maxSecond <= WAIT_MAX_SECOND, maxSecond = WAIT_MAX_SECOND, "WaitForFile max time is 5s");
|
||||
struct stat sourceInfo = {};
|
||||
struct stat sourceInfo = {0};
|
||||
unsigned int waitTime = 500000;
|
||||
/* 500ms interval, check maxSecond*2 times total */
|
||||
unsigned int maxCount = maxSecond * 2;
|
||||
@ -382,7 +382,7 @@ int MakeDir(const char *dir, mode_t mode)
|
||||
int MakeDirRecursive(const char *dir, mode_t mode)
|
||||
{
|
||||
int rc = -1;
|
||||
char buffer[PATH_MAX] = {};
|
||||
char buffer[PATH_MAX] = {0};
|
||||
const char *p = NULL;
|
||||
if (dir == NULL || *dir == '\0') {
|
||||
errno = EINVAL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user