未验证 提交 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)) {
"_GNU_SOURCE",
"OHOS_LITE",
]
cflags = [ "-fPIC" ]
public_configs = [ ":exported_header_files" ]
if (ohos_kernel_type == "linux") {
......
......@@ -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) - 1] = '\0';
}
PrintLog(logLevel, domain, tag, tmpFmt);
PrintLog((InitLogLevel)logLevel, domain, tag, tmpFmt);
}
INIT_PUBLIC_API void EnableInitLog(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);
......@@ -169,7 +169,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)
{
}
\ No newline at end of file
}
......@@ -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
}
\ No newline at end of file
}
......@@ -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__)
......@@ -242,4 +242,4 @@ int LoadPersistParams(void)
}
#endif
return 0;
}
\ No newline at end of file
}
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册