未验证 提交 85d86bd3 编写于 作者: O openharmony_ci 提交者: Gitee

!1335 iccarm工具链支持同步至OpenHarmony-3.2-Beta3分支

Merge pull request !1335 from wish/cherry-pick-1664436235
...@@ -27,7 +27,6 @@ if (defined(ohos_lite)) { ...@@ -27,7 +27,6 @@ if (defined(ohos_lite)) {
"_GNU_SOURCE", "_GNU_SOURCE",
"OHOS_LITE", "OHOS_LITE",
] ]
cflags = [ "-fPIC" ]
public_configs = [ ":exported_header_files" ] public_configs = [ ":exported_header_files" ]
if (ohos_kernel_type == "linux") { if (ohos_kernel_type == "linux") {
......
...@@ -128,7 +128,7 @@ INIT_LOCAL_API void InitLog(int logLevel, unsigned int domain, const char *tag, ...@@ -128,7 +128,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) - 2] = '\n'; // 2 add \n to tail
tmpFmt[sizeof(tmpFmt) - 1] = '\0'; tmpFmt[sizeof(tmpFmt) - 1] = '\0';
} }
PrintLog(logLevel, domain, tag, tmpFmt); PrintLog((InitLogLevel)logLevel, domain, tag, tmpFmt);
} }
INIT_PUBLIC_API void EnableInitLog(InitLogLevel level) INIT_PUBLIC_API void EnableInitLog(InitLogLevel level)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "param_manager.h" #include "param_manager.h"
#include "param_trie.h" #include "param_trie.h"
static ParamWorkSpace g_paramWorkSpace = {}; static ParamWorkSpace g_paramWorkSpace = {0};
PARAM_STATIC int WorkSpaceNodeCompare(const HashNode *node1, const HashNode *node2) PARAM_STATIC int WorkSpaceNodeCompare(const HashNode *node1, const HashNode *node2)
{ {
WorkSpace *workSpace1 = HASHMAP_ENTRY(node1, WorkSpace, hashNode); WorkSpace *workSpace1 = HASHMAP_ENTRY(node1, WorkSpace, hashNode);
...@@ -169,7 +169,7 @@ INIT_INNER_API int InitParamWorkSpace(int onlyRead, const PARAM_WORKSPACE_OPS *o ...@@ -169,7 +169,7 @@ INIT_INNER_API int InitParamWorkSpace(int onlyRead, const PARAM_WORKSPACE_OPS *o
// load user info for dac // load user info for dac
LoadGroupUser(); LoadGroupUser();
// add default dac policy // add default dac policy
ParamAuditData auditData = {}; ParamAuditData auditData = {0};
auditData.name = "#"; auditData.name = "#";
auditData.dacData.gid = DAC_DEFAULT_GROUP; // 2000 for shell auditData.dacData.gid = DAC_DEFAULT_GROUP; // 2000 for shell
auditData.dacData.uid = DAC_DEFAULT_USER; // for root auditData.dacData.uid = DAC_DEFAULT_USER; // for root
......
...@@ -24,9 +24,11 @@ ...@@ -24,9 +24,11 @@
#include "selinux_parameter.h" #include "selinux_parameter.h"
#else #else
typedef struct ParamContextsList_ { typedef struct ParamContextsList_ {
char unused;
} ParamContextsList; } ParamContextsList;
typedef struct SrcInfo { typedef struct SrcInfo {
char unused;
} SrcInfo; } SrcInfo;
#endif #endif
......
...@@ -108,7 +108,6 @@ static_library("param_init_lite") { ...@@ -108,7 +108,6 @@ static_library("param_init_lite") {
static_library("param_client_lite") { static_library("param_client_lite") {
sources = base_sources sources = base_sources
include_dirs = param_include_dirs include_dirs = param_include_dirs
cflags = [ "-fPIC" ]
defines = param_build_defines defines = param_build_defines
public_configs = [ ":exported_header_files" ] public_configs = [ ":exported_header_files" ]
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
static int g_flags = 0; static int g_flags = 0;
__attribute__((constructor)) static void ClientInit(void); __attribute__((constructor)) static void ClientInit(void);
__attribute__((destructor)) static void ClientDeinit(void); static void ClientDeinit(void);
static int InitParamClient(void) static int InitParamClient(void)
{ {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "utils_file.h" #include "utils_file.h"
// for linux, no mutex // for linux, no mutex
static ParamMutex g_saveMutex = {}; static ParamMutex g_saveMutex = {0};
#ifdef PARAM_SUPPORT_POSIX #ifdef PARAM_SUPPORT_POSIX
#define MODE_READ O_RDONLY #define MODE_READ O_RDONLY
#define MODE_APPEND (O_RDWR | O_CREAT | O_APPEND) #define MODE_APPEND (O_RDWR | O_CREAT | O_APPEND)
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
*/ */
#include "param_osadp.h" #include "param_osadp.h"
#include "param_security.h" #include "param_security.h"
#include "securec.h"
static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit) static int InitLocalSecurityLabel(ParamSecurityLabel *security, int isInit)
{ {
...@@ -81,4 +82,4 @@ INIT_LOCAL_API int RegisterSecurityDacOps(ParamSecurityOps *ops, int isInit) ...@@ -81,4 +82,4 @@ INIT_LOCAL_API int RegisterSecurityDacOps(ParamSecurityOps *ops, int isInit)
INIT_LOCAL_API void LoadGroupUser(void) INIT_LOCAL_API void LoadGroupUser(void)
{ {
} }
\ No newline at end of file
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <sys/shm.h> #include <sys/shm.h>
#else #else
#include "los_task.h" #include "los_task.h"
#include "los_mux.h"
#endif #endif
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
...@@ -318,4 +319,4 @@ INIT_LOCAL_API uint32_t Difftime(time_t curr, time_t base) ...@@ -318,4 +319,4 @@ INIT_LOCAL_API uint32_t Difftime(time_t curr, time_t base)
(void)base; (void)base;
return 0; return 0;
#endif #endif
} }
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "param_osadp.h" #include "param_osadp.h"
#include "securec.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) static int IsNeedToSave(const char *name)
{ {
#if defined(__LITEOS_M__) || defined(__LITEOS_A__) #if defined(__LITEOS_M__) || defined(__LITEOS_A__)
...@@ -242,4 +242,4 @@ int LoadPersistParams(void) ...@@ -242,4 +242,4 @@ int LoadPersistParams(void)
} }
#endif #endif
return 0; return 0;
} }
\ No newline at end of file
...@@ -322,7 +322,7 @@ char **SplitStringExt(char *buffer, const char *del, int *returnCount, int maxIt ...@@ -322,7 +322,7 @@ char **SplitStringExt(char *buffer, const char *del, int *returnCount, int maxIt
void WaitForFile(const char *source, unsigned int maxSecond) void WaitForFile(const char *source, unsigned int maxSecond)
{ {
INIT_ERROR_CHECK(maxSecond <= WAIT_MAX_SECOND, maxSecond = WAIT_MAX_SECOND, "WaitForFile max time is 5s"); 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; unsigned int waitTime = 500000;
/* 500ms interval, check maxSecond*2 times total */ /* 500ms interval, check maxSecond*2 times total */
unsigned int maxCount = maxSecond * 2; unsigned int maxCount = maxSecond * 2;
...@@ -382,7 +382,7 @@ int MakeDir(const char *dir, mode_t mode) ...@@ -382,7 +382,7 @@ int MakeDir(const char *dir, mode_t mode)
int MakeDirRecursive(const char *dir, mode_t mode) int MakeDirRecursive(const char *dir, mode_t mode)
{ {
int rc = -1; int rc = -1;
char buffer[PATH_MAX] = {}; char buffer[PATH_MAX] = {0};
const char *p = NULL; const char *p = NULL;
if (dir == NULL || *dir == '\0') { if (dir == NULL || *dir == '\0') {
errno = EINVAL; errno = EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册