提交 cc8fc0f3 编写于 作者: W Wen liumin

Fix spelling mistakes

Signed-off-by: NWen liumin <904600657@qq.com>
上级 dc6c151d
...@@ -51,7 +51,7 @@ typedef struct { ...@@ -51,7 +51,7 @@ typedef struct {
#define QUICKSTART_NODE "/dev/quickstart" #define QUICKSTART_NODE "/dev/quickstart"
/* Simple sample Useage: /* Simple sample Usage:
* INIT PROCESS * INIT PROCESS
* SystemInitStage(QS_STAGE1)----(1)fork----> key APP * SystemInitStage(QS_STAGE1)----(1)fork----> key APP
* |(2) |(3) * |(2) |(3)
......
...@@ -38,7 +38,7 @@ static int g_FifoWriteFd = -1; ...@@ -38,7 +38,7 @@ static int g_FifoWriteFd = -1;
static void ProcessFifoWrite(const WatcherHandle taskHandle, int fd, uint32_t *events, const void *context) static void ProcessFifoWrite(const WatcherHandle taskHandle, int fd, uint32_t *events, const void *context)
{ {
if ((fd < 0) || (events == NULL) || (context == NULL)) { if ((fd < 0) || (events == NULL) || (context == NULL)) {
BEGET_LOGE("[control_fd] Invaild fifo write parameter"); BEGET_LOGE("[control_fd] Invalid fifo write parameter");
return; return;
} }
int fifow = *((int *)context); int fifow = *((int *)context);
...@@ -63,7 +63,7 @@ static void ProcessFifoWrite(const WatcherHandle taskHandle, int fd, uint32_t *e ...@@ -63,7 +63,7 @@ static void ProcessFifoWrite(const WatcherHandle taskHandle, int fd, uint32_t *e
static void ProcessFifoRead(const WatcherHandle taskHandle, int fd, uint32_t *events, const void *context) static void ProcessFifoRead(const WatcherHandle taskHandle, int fd, uint32_t *events, const void *context)
{ {
if ((fd < 0) || (events == NULL)) { if ((fd < 0) || (events == NULL)) {
BEGET_LOGE("[control_fd] Invaild fifo read parameter"); BEGET_LOGE("[control_fd] Invalid fifo read parameter");
return; return;
} }
char buf[FIFO_BUF_SIZE] = {0}; char buf[FIFO_BUF_SIZE] = {0};
...@@ -123,7 +123,7 @@ static void CmdDisConnectComplete(const TaskHandle client) ...@@ -123,7 +123,7 @@ static void CmdDisConnectComplete(const TaskHandle client)
static void CmdAgentInit(WatcherHandle handle, const char *path, bool read, ProcessWatchEvent func) static void CmdAgentInit(WatcherHandle handle, const char *path, bool read, ProcessWatchEvent func)
{ {
if (path == NULL) { if (path == NULL) {
BEGET_LOGE("[control_fd] Invaild parameter"); BEGET_LOGE("[control_fd] Invalid parameter");
return; return;
} }
BEGET_LOGI("[control_fd] client open %s", (read ? "read" : "write")); BEGET_LOGI("[control_fd] client open %s", (read ? "read" : "write"));
...@@ -173,7 +173,7 @@ static void CmdOnSendMessageComplete(const TaskHandle task, const BufferHandle h ...@@ -173,7 +173,7 @@ static void CmdOnSendMessageComplete(const TaskHandle task, const BufferHandle h
static CmdAgent *CmdAgentCreate(const char *server) static CmdAgent *CmdAgentCreate(const char *server)
{ {
if (server == NULL) { if (server == NULL) {
BEGET_LOGE("[control_fd] Invaild parameter"); BEGET_LOGE("[control_fd] Invalid parameter");
return NULL; return NULL;
} }
TaskHandle task = NULL; TaskHandle task = NULL;
...@@ -197,7 +197,7 @@ static CmdAgent *CmdAgentCreate(const char *server) ...@@ -197,7 +197,7 @@ static CmdAgent *CmdAgentCreate(const char *server)
static int CreateFifo(const char *pipeName) static int CreateFifo(const char *pipeName)
{ {
if (pipeName == NULL) { if (pipeName == NULL) {
BEGET_LOGE("[control_fd] Invaild parameter"); BEGET_LOGE("[control_fd] Invalid parameter");
return -1; return -1;
} }
// create fifo for cmd // create fifo for cmd
...@@ -214,7 +214,7 @@ static int CreateFifo(const char *pipeName) ...@@ -214,7 +214,7 @@ static int CreateFifo(const char *pipeName)
static int SendCmdMessage(const CmdAgent *agent, uint16_t type, const char *cmd, const char *fifoName) static int SendCmdMessage(const CmdAgent *agent, uint16_t type, const char *cmd, const char *fifoName)
{ {
if ((agent == NULL) || (cmd == NULL) || (fifoName == NULL)) { if ((agent == NULL) || (cmd == NULL) || (fifoName == NULL)) {
BEGET_LOGE("[control_fd] Invaild parameter"); BEGET_LOGE("[control_fd] Invalid parameter");
return -1; return -1;
} }
int ret = 0; int ret = 0;
...@@ -242,7 +242,7 @@ static int SendCmdMessage(const CmdAgent *agent, uint16_t type, const char *cmd, ...@@ -242,7 +242,7 @@ static int SendCmdMessage(const CmdAgent *agent, uint16_t type, const char *cmd,
static int CmdMakeFifoInit(const char *fifoPath) static int CmdMakeFifoInit(const char *fifoPath)
{ {
if (fifoPath == NULL) { if (fifoPath == NULL) {
BEGET_LOGE("[control_fd] Invaild parameter"); BEGET_LOGE("[control_fd] Invalid parameter");
return -1; return -1;
} }
int ret = sprintf_s(g_FifoReadPath, sizeof(g_FifoReadPath) - 1, "/dev/fifo/%s0.%d", fifoPath, getpid()); int ret = sprintf_s(g_FifoReadPath, sizeof(g_FifoReadPath) - 1, "/dev/fifo/%s0.%d", fifoPath, getpid());
...@@ -260,7 +260,7 @@ static int CmdMakeFifoInit(const char *fifoPath) ...@@ -260,7 +260,7 @@ static int CmdMakeFifoInit(const char *fifoPath)
void CmdClientInit(const char *socketPath, uint16_t type, const char *cmd, const char *fifoName) void CmdClientInit(const char *socketPath, uint16_t type, const char *cmd, const char *fifoName)
{ {
if ((socketPath == NULL) || (cmd == NULL)) { if ((socketPath == NULL) || (cmd == NULL)) {
BEGET_LOGE("[control_fd] Invaild parameter"); BEGET_LOGE("[control_fd] Invalid parameter");
} }
BEGET_LOGI("[control_fd] CmdAgentInit"); BEGET_LOGI("[control_fd] CmdAgentInit");
int ret = CmdMakeFifoInit(fifoName); int ret = CmdMakeFifoInit(fifoName);
......
...@@ -256,7 +256,7 @@ static int Mount(const char *source, const char *target, const char *fsType, ...@@ -256,7 +256,7 @@ static int Mount(const char *source, const char *target, const char *fsType,
int rc = -1; int rc = -1;
if (source == NULL || target == NULL || fsType == NULL) { if (source == NULL || target == NULL || fsType == NULL) {
BEGET_LOGE("Invalid argment for mount."); BEGET_LOGE("Invalid argument for mount.");
return -1; return -1;
} }
if (stat(target, &st) != 0 && errno != ENOENT) { if (stat(target, &st) != 0 && errno != ENOENT) {
......
...@@ -28,7 +28,7 @@ config("init_module_engine_exported_config") { ...@@ -28,7 +28,7 @@ config("init_module_engine_exported_config") {
} }
# #
# innerkits for module developement # innerkits for module development
# #
ohos_native_stub_library("libinit_module_engine") { ohos_native_stub_library("libinit_module_engine") {
output_extension = "so" output_extension = "so"
......
...@@ -52,7 +52,7 @@ int UnshareNamespace(int nsType) ...@@ -52,7 +52,7 @@ int UnshareNamespace(int nsType)
int SetNamespace(int nsFd, int nsType) int SetNamespace(int nsFd, int nsType)
{ {
if (nsFd < 0) { if (nsFd < 0) {
BEGET_LOGE("Namespace fd is invaild"); BEGET_LOGE("Namespace fd is invalid");
return -1; return -1;
} }
if (nsType != CLONE_NEWNS) { if (nsType != CLONE_NEWNS) {
......
...@@ -228,7 +228,7 @@ int ServiceSetReady(const char *serviceName) ...@@ -228,7 +228,7 @@ int ServiceSetReady(const char *serviceName)
int StartServiceByTimer(const char *serviceName, uint64_t timeout) int StartServiceByTimer(const char *serviceName, uint64_t timeout)
{ {
if (serviceName == NULL) { if (serviceName == NULL) {
BEGET_LOGE("Request start serivce by timer with invalid service name"); BEGET_LOGE("Request start service by timer with invalid service name");
return -1; return -1;
} }
...@@ -253,7 +253,7 @@ int StartServiceByTimer(const char *serviceName, uint64_t timeout) ...@@ -253,7 +253,7 @@ int StartServiceByTimer(const char *serviceName, uint64_t timeout)
int StopServiceTimer(const char *serviceName) int StopServiceTimer(const char *serviceName)
{ {
if (serviceName == NULL) { if (serviceName == NULL) {
BEGET_LOGE("Request stop serivce timer with invalid service name"); BEGET_LOGE("Request stop service timer with invalid service name");
return -1; return -1;
} }
......
...@@ -25,7 +25,7 @@ const.allow.mock.location = root:root:0777 ...@@ -25,7 +25,7 @@ const.allow.mock.location = root:root:0777
const.debuggable = root:root:0777 const.debuggable = root:root:0777
persist.sys.usb.config = root:root:0777 persist.sys.usb.config = root:root:0777
# default forbit other user to start service # default forbid other user to start service
ohos.servicectrl. = system:servicectrl:0775 ohos.servicectrl. = system:servicectrl:0775
ohos.startup.powerctrl. = system:powerctrl:0775 ohos.startup.powerctrl. = system:powerctrl:0775
ohos.boot. = system:bootctrl:0775 ohos.boot. = system:bootctrl:0775
...@@ -36,4 +36,4 @@ persist.window.boot. = root:system:0775 ...@@ -36,4 +36,4 @@ persist.window.boot. = root:system:0775
#permission for log #permission for log
debug.bytrace. = root:system:0775 debug.bytrace. = root:system:0775
persist.distributed_hardware.device_manager. = system:system:0775 persist.distributed_hardware.device_manager. = system:system:0775
\ No newline at end of file
...@@ -79,7 +79,7 @@ void ListAddTail(struct ListNode *list, struct ListNode *item); ...@@ -79,7 +79,7 @@ void ListAddTail(struct ListNode *list, struct ListNode *item);
void ListRemove(struct ListNode *item); void ListRemove(struct ListNode *item);
/** /**
* @brief ListNode comparision function prototype * @brief ListNode comparison function prototype
* *
* @param node ListNode to be compared. * @param node ListNode to be compared.
* @param newNode new ListNode to be compared. * @param newNode new ListNode to be compared.
...@@ -132,9 +132,9 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr ...@@ -132,9 +132,9 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
* @brief Traversal the list with specified function * @brief Traversal the list with specified function
* *
* @param head list head, make sure head is valid pointer. * @param head list head, make sure head is valid pointer.
* @param cookie optinal traversing data. * @param cookie optional traversing data.
* @param traversalProc comparing function, return 0 if matched. * @param traversalProc comparing function, return 0 if matched.
* @param flags optinal traversing flags: * @param flags optional traversing flags:
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node; * TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
* default behaviour is from first node to last node * default behaviour is from first node to last node
* TRAVERSE_STOP_WHEN_ERROR: stop traversing if traversalProc return non-zero * TRAVERSE_STOP_WHEN_ERROR: stop traversing if traversalProc return non-zero
......
...@@ -70,12 +70,12 @@ static void ParseJob(const cJSON *jobItem, Job *resJob) ...@@ -70,12 +70,12 @@ static void ParseJob(const cJSON *jobItem, Job *resJob)
cJSON *cmdsItem = cJSON_GetObjectItem(jobItem, CMDS_ARR_NAME_IN_JSON); cJSON *cmdsItem = cJSON_GetObjectItem(jobItem, CMDS_ARR_NAME_IN_JSON);
if (!cJSON_IsArray(cmdsItem)) { if (!cJSON_IsArray(cmdsItem)) {
INIT_LOGE("job %s is not an arrary", resJob->name); INIT_LOGE("job %s is not an array", resJob->name);
return; return;
} }
int ret = GetCmdLinesFromJson(cmdsItem, &resJob->cmdLines); int ret = GetCmdLinesFromJson(cmdsItem, &resJob->cmdLines);
if (ret != 0) { if (ret != 0) {
INIT_LOGE("ParseJob, faild to get cmds for job!"); INIT_LOGE("ParseJob, failed to get cmds for job!");
return; return;
} }
return; return;
......
...@@ -55,10 +55,10 @@ static int ParseRequiredMountInfo(const char *item, Fstab *fstab) ...@@ -55,10 +55,10 @@ static int ParseRequiredMountInfo(const char *item, Fstab *fstab)
q = item + strlen(OHOS_REQUIRED_MOUNT_PREFIX); // Get partition name q = item + strlen(OHOS_REQUIRED_MOUNT_PREFIX); // Get partition name
INIT_CHECK(!(q == NULL || *q == '\0' || (p - q) <= 0), return -1); INIT_CHECK(!(q == NULL || *q == '\0' || (p - q) <= 0), return -1);
INIT_ERROR_CHECK(strncpy_s(partName, PARTITION_NAME_SIZE -1, q, p - q) == EOK, INIT_ERROR_CHECK(strncpy_s(partName, PARTITION_NAME_SIZE -1, q, p - q) == EOK,
return -1, "Failed to copy requried partition name"); return -1, "Failed to copy required partition name");
p++; // skip '=' p++; // skip '='
INIT_ERROR_CHECK(strncpy_s(mountOptions, MAX_BUFFER_LEN -1, p, strlen(p)) == EOK, INIT_ERROR_CHECK(strncpy_s(mountOptions, MAX_BUFFER_LEN -1, p, strlen(p)) == EOK,
return -1, "Failed to copy requried mount info: %s", item); return -1, "Failed to copy required mount info: %s", item);
} }
INIT_LOGV("Mount option of partition %s is [%s]", partName, mountOptions); INIT_LOGV("Mount option of partition %s is [%s]", partName, mountOptions);
if (ParseFstabPerLine(mountOptions, fstab, false, "@") < 0) { if (ParseFstabPerLine(mountOptions, fstab, false, "@") < 0) {
......
...@@ -260,7 +260,7 @@ static int DoBootchartStop(void) ...@@ -260,7 +260,7 @@ static int DoBootchartStop(void)
pthread_mutex_unlock(&(g_bootchartCtrl->mutex)); pthread_mutex_unlock(&(g_bootchartCtrl->mutex));
pthread_join(g_bootchartCtrl->threadId, NULL); pthread_join(g_bootchartCtrl->threadId, NULL);
BootchartDestory(); BootchartDestory();
PLUGIN_LOGI("bootcharting stoped"); PLUGIN_LOGI("bootcharting stopped");
return 0; return 0;
} }
......
...@@ -171,7 +171,7 @@ void SystemDumpParameters(int verbose) ...@@ -171,7 +171,7 @@ void SystemDumpParameters(int verbose)
if (ret != PARAM_CODE_NOT_FOUND && ret != 0 && ret != PARAM_CODE_NODE_EXIST) { if (ret != PARAM_CODE_NOT_FOUND && ret != 0 && ret != PARAM_CODE_NODE_EXIST) {
PARAM_CHECK(ret == 0, return, "Forbid to dump parameters"); PARAM_CHECK(ret == 0, return, "Forbid to dump parameters");
} }
PARAM_DUMP("Dump all paramters begin ...\n"); PARAM_DUMP("Dump all parameters begin ...\n");
if (verbose) { if (verbose) {
PARAM_DUMP("Local sercurity information\n"); PARAM_DUMP("Local sercurity information\n");
PARAM_DUMP("\t pid: %d uid: %d gid: %d \n", PARAM_DUMP("\t pid: %d uid: %d gid: %d \n",
...@@ -185,7 +185,7 @@ void SystemDumpParameters(int verbose) ...@@ -185,7 +185,7 @@ void SystemDumpParameters(int verbose)
HashNodeTraverseForDump(workSpace, verbose); HashNodeTraverseForDump(workSpace, verbose);
workSpace = next; workSpace = next;
} }
PARAM_DUMP("Dump all paramters finish\n"); PARAM_DUMP("Dump all parameters finish\n");
} }
INIT_INNER_API int SysCheckParamExist(const char *name) INIT_INNER_API int SysCheckParamExist(const char *name)
......
...@@ -403,16 +403,16 @@ static int ExecTriggerMatch_(const TriggerWorkSpace *workSpace, ...@@ -403,16 +403,16 @@ static int ExecTriggerMatch_(const TriggerWorkSpace *workSpace,
static int CheckBootMatch_(const TriggerWorkSpace *workSpace, static int CheckBootMatch_(const TriggerWorkSpace *workSpace,
int type, LogicCalculator *calculator, const char *content, uint32_t contentSize) int type, LogicCalculator *calculator, const char *content, uint32_t contentSize)
{ {
PARAM_CHECK(workSpace != NULL, return -1, "Invaid space"); PARAM_CHECK(workSpace != NULL, return -1, "Invalid space");
PARAM_CHECK((type == TRIGGER_BOOT) || (type == TRIGGER_PARAM_WATCH), return -1, "Invaid type"); PARAM_CHECK((type == TRIGGER_BOOT) || (type == TRIGGER_PARAM_WATCH), return -1, "Invalid type");
return ExecTriggerMatch_(workSpace, type, calculator, content, contentSize); return ExecTriggerMatch_(workSpace, type, calculator, content, contentSize);
} }
static int CheckParamMatch_(const TriggerWorkSpace *workSpace, static int CheckParamMatch_(const TriggerWorkSpace *workSpace,
int type, LogicCalculator *calculator, const char *content, uint32_t contentSize) int type, LogicCalculator *calculator, const char *content, uint32_t contentSize)
{ {
PARAM_CHECK(workSpace != NULL, return -1, "Invaid space"); PARAM_CHECK(workSpace != NULL, return -1, "Invalid space");
PARAM_CHECK((type == TRIGGER_PARAM) || (type == TRIGGER_PARAM_WAIT), return -1, "Invaid type"); PARAM_CHECK((type == TRIGGER_PARAM) || (type == TRIGGER_PARAM_WAIT), return -1, "Invalid type");
CalculatorInit(calculator, MAX_CONDITION_NUMBER, sizeof(LogicData), 1); CalculatorInit(calculator, MAX_CONDITION_NUMBER, sizeof(LogicData), 1);
int ret = GetValueFromContent(content, contentSize, 0, calculator->inputName, SUPPORT_DATA_BUFFER_MAX); int ret = GetValueFromContent(content, contentSize, 0, calculator->inputName, SUPPORT_DATA_BUFFER_MAX);
...@@ -427,7 +427,7 @@ static int CheckUnknowMatch_(const TriggerWorkSpace *workSpace, ...@@ -427,7 +427,7 @@ static int CheckUnknowMatch_(const TriggerWorkSpace *workSpace,
int type, LogicCalculator *calculator, const char *content, uint32_t contentSize) int type, LogicCalculator *calculator, const char *content, uint32_t contentSize)
{ {
PARAM_CHECK(workSpace != NULL && content != NULL, return -1, "Failed arg for trigger"); PARAM_CHECK(workSpace != NULL && content != NULL, return -1, "Failed arg for trigger");
PARAM_CHECK(type == TRIGGER_UNKNOW, return -1, "Invaid type"); PARAM_CHECK(type == TRIGGER_UNKNOW, return -1, "Invalid type");
CalculatorInit(calculator, MAX_CONDITION_NUMBER, sizeof(LogicData), 1); CalculatorInit(calculator, MAX_CONDITION_NUMBER, sizeof(LogicData), 1);
int ret = memcpy_s(calculator->triggerContent, sizeof(calculator->triggerContent), content, contentSize); int ret = memcpy_s(calculator->triggerContent, sizeof(calculator->triggerContent), content, contentSize);
...@@ -760,4 +760,4 @@ const char *GetTriggerName(const TriggerNode *trigger) ...@@ -760,4 +760,4 @@ const char *GetTriggerName(const TriggerNode *trigger)
return triggerHead->getTriggerName(trigger); return triggerHead->getTriggerName(trigger);
} }
return ""; return "";
} }
\ No newline at end of file
...@@ -142,7 +142,7 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr ...@@ -142,7 +142,7 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
* @brief Traversal the list with specified function * @brief Traversal the list with specified function
* *
* @param head list head, make sure head is valid pointer. * @param head list head, make sure head is valid pointer.
* @param cookie optinal traversing data. * @param cookie optional traversing data.
* @param traversalProc comparing function, return 0 if matched. * @param traversalProc comparing function, return 0 if matched.
* @param flags optinal traversing flags: * @param flags optinal traversing flags:
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node; * TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册