mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-27 02:10:33 +00:00
Fix spelling mistakes
Signed-off-by: Wen liumin <904600657@qq.com>
This commit is contained in:
parent
dc6c151d97
commit
cc8fc0f322
@ -51,7 +51,7 @@ typedef struct {
|
||||
|
||||
#define QUICKSTART_NODE "/dev/quickstart"
|
||||
|
||||
/* Simple sample Useage:
|
||||
/* Simple sample Usage:
|
||||
* INIT PROCESS
|
||||
* SystemInitStage(QS_STAGE1)----(1)fork----> key APP
|
||||
* |(2) |(3)
|
||||
|
@ -38,7 +38,7 @@ static int g_FifoWriteFd = -1;
|
||||
static void ProcessFifoWrite(const WatcherHandle taskHandle, int fd, uint32_t *events, const void *context)
|
||||
{
|
||||
if ((fd < 0) || (events == NULL) || (context == NULL)) {
|
||||
BEGET_LOGE("[control_fd] Invaild fifo write parameter");
|
||||
BEGET_LOGE("[control_fd] Invalid fifo write parameter");
|
||||
return;
|
||||
}
|
||||
int fifow = *((int *)context);
|
||||
@ -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)
|
||||
{
|
||||
if ((fd < 0) || (events == NULL)) {
|
||||
BEGET_LOGE("[control_fd] Invaild fifo read parameter");
|
||||
BEGET_LOGE("[control_fd] Invalid fifo read parameter");
|
||||
return;
|
||||
}
|
||||
char buf[FIFO_BUF_SIZE] = {0};
|
||||
@ -123,7 +123,7 @@ static void CmdDisConnectComplete(const TaskHandle client)
|
||||
static void CmdAgentInit(WatcherHandle handle, const char *path, bool read, ProcessWatchEvent func)
|
||||
{
|
||||
if (path == NULL) {
|
||||
BEGET_LOGE("[control_fd] Invaild parameter");
|
||||
BEGET_LOGE("[control_fd] Invalid parameter");
|
||||
return;
|
||||
}
|
||||
BEGET_LOGI("[control_fd] client open %s", (read ? "read" : "write"));
|
||||
@ -173,7 +173,7 @@ static void CmdOnSendMessageComplete(const TaskHandle task, const BufferHandle h
|
||||
static CmdAgent *CmdAgentCreate(const char *server)
|
||||
{
|
||||
if (server == NULL) {
|
||||
BEGET_LOGE("[control_fd] Invaild parameter");
|
||||
BEGET_LOGE("[control_fd] Invalid parameter");
|
||||
return NULL;
|
||||
}
|
||||
TaskHandle task = NULL;
|
||||
@ -197,7 +197,7 @@ static CmdAgent *CmdAgentCreate(const char *server)
|
||||
static int CreateFifo(const char *pipeName)
|
||||
{
|
||||
if (pipeName == NULL) {
|
||||
BEGET_LOGE("[control_fd] Invaild parameter");
|
||||
BEGET_LOGE("[control_fd] Invalid parameter");
|
||||
return -1;
|
||||
}
|
||||
// create fifo for cmd
|
||||
@ -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)
|
||||
{
|
||||
if ((agent == NULL) || (cmd == NULL) || (fifoName == NULL)) {
|
||||
BEGET_LOGE("[control_fd] Invaild parameter");
|
||||
BEGET_LOGE("[control_fd] Invalid parameter");
|
||||
return -1;
|
||||
}
|
||||
int ret = 0;
|
||||
@ -242,7 +242,7 @@ static int SendCmdMessage(const CmdAgent *agent, uint16_t type, const char *cmd,
|
||||
static int CmdMakeFifoInit(const char *fifoPath)
|
||||
{
|
||||
if (fifoPath == NULL) {
|
||||
BEGET_LOGE("[control_fd] Invaild parameter");
|
||||
BEGET_LOGE("[control_fd] Invalid parameter");
|
||||
return -1;
|
||||
}
|
||||
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)
|
||||
void CmdClientInit(const char *socketPath, uint16_t type, const char *cmd, const char *fifoName)
|
||||
{
|
||||
if ((socketPath == NULL) || (cmd == NULL)) {
|
||||
BEGET_LOGE("[control_fd] Invaild parameter");
|
||||
BEGET_LOGE("[control_fd] Invalid parameter");
|
||||
}
|
||||
BEGET_LOGI("[control_fd] CmdAgentInit");
|
||||
int ret = CmdMakeFifoInit(fifoName);
|
||||
|
@ -256,7 +256,7 @@ static int Mount(const char *source, const char *target, const char *fsType,
|
||||
int rc = -1;
|
||||
|
||||
if (source == NULL || target == NULL || fsType == NULL) {
|
||||
BEGET_LOGE("Invalid argment for mount.");
|
||||
BEGET_LOGE("Invalid argument for mount.");
|
||||
return -1;
|
||||
}
|
||||
if (stat(target, &st) != 0 && errno != ENOENT) {
|
||||
|
@ -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") {
|
||||
output_extension = "so"
|
||||
|
@ -52,7 +52,7 @@ int UnshareNamespace(int nsType)
|
||||
int SetNamespace(int nsFd, int nsType)
|
||||
{
|
||||
if (nsFd < 0) {
|
||||
BEGET_LOGE("Namespace fd is invaild");
|
||||
BEGET_LOGE("Namespace fd is invalid");
|
||||
return -1;
|
||||
}
|
||||
if (nsType != CLONE_NEWNS) {
|
||||
|
@ -228,7 +228,7 @@ int ServiceSetReady(const char *serviceName)
|
||||
int StartServiceByTimer(const char *serviceName, uint64_t timeout)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ int StartServiceByTimer(const char *serviceName, uint64_t timeout)
|
||||
int StopServiceTimer(const char *serviceName)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ const.allow.mock.location = root:root:0777
|
||||
const.debuggable = 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.startup.powerctrl. = system:powerctrl:0775
|
||||
ohos.boot. = system:bootctrl:0775
|
||||
@ -36,4 +36,4 @@ persist.window.boot. = root:system:0775
|
||||
#permission for log
|
||||
debug.bytrace. = root:system:0775
|
||||
|
||||
persist.distributed_hardware.device_manager. = system:system:0775
|
||||
persist.distributed_hardware.device_manager. = system:system:0775
|
||||
|
@ -79,7 +79,7 @@ void ListAddTail(struct ListNode *list, 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 newNode new ListNode to be compared.
|
||||
@ -132,9 +132,9 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
|
||||
* @brief Traversal the list with specified function
|
||||
*
|
||||
* @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 flags optinal traversing flags:
|
||||
* @param flags optional traversing flags:
|
||||
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
|
||||
* default behaviour is from first node to last node
|
||||
* TRAVERSE_STOP_WHEN_ERROR: stop traversing if traversalProc return non-zero
|
||||
|
@ -70,12 +70,12 @@ static void ParseJob(const cJSON *jobItem, Job *resJob)
|
||||
|
||||
cJSON *cmdsItem = cJSON_GetObjectItem(jobItem, CMDS_ARR_NAME_IN_JSON);
|
||||
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;
|
||||
}
|
||||
int ret = GetCmdLinesFromJson(cmdsItem, &resJob->cmdLines);
|
||||
if (ret != 0) {
|
||||
INIT_LOGE("ParseJob, faild to get cmds for job!");
|
||||
INIT_LOGE("ParseJob, failed to get cmds for job!");
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
@ -55,10 +55,10 @@ static int ParseRequiredMountInfo(const char *item, Fstab *fstab)
|
||||
q = item + strlen(OHOS_REQUIRED_MOUNT_PREFIX); // Get partition name
|
||||
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,
|
||||
return -1, "Failed to copy requried partition name");
|
||||
return -1, "Failed to copy required partition name");
|
||||
p++; // skip '='
|
||||
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);
|
||||
if (ParseFstabPerLine(mountOptions, fstab, false, "@") < 0) {
|
||||
|
@ -260,7 +260,7 @@ static int DoBootchartStop(void)
|
||||
pthread_mutex_unlock(&(g_bootchartCtrl->mutex));
|
||||
pthread_join(g_bootchartCtrl->threadId, NULL);
|
||||
BootchartDestory();
|
||||
PLUGIN_LOGI("bootcharting stoped");
|
||||
PLUGIN_LOGI("bootcharting stopped");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ void SystemDumpParameters(int verbose)
|
||||
if (ret != PARAM_CODE_NOT_FOUND && ret != 0 && ret != PARAM_CODE_NODE_EXIST) {
|
||||
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) {
|
||||
PARAM_DUMP("Local sercurity information\n");
|
||||
PARAM_DUMP("\t pid: %d uid: %d gid: %d \n",
|
||||
@ -185,7 +185,7 @@ void SystemDumpParameters(int verbose)
|
||||
HashNodeTraverseForDump(workSpace, verbose);
|
||||
workSpace = next;
|
||||
}
|
||||
PARAM_DUMP("Dump all paramters finish\n");
|
||||
PARAM_DUMP("Dump all parameters finish\n");
|
||||
}
|
||||
|
||||
INIT_INNER_API int SysCheckParamExist(const char *name)
|
||||
|
@ -403,16 +403,16 @@ static int ExecTriggerMatch_(const TriggerWorkSpace *workSpace,
|
||||
static int CheckBootMatch_(const TriggerWorkSpace *workSpace,
|
||||
int type, LogicCalculator *calculator, const char *content, uint32_t contentSize)
|
||||
{
|
||||
PARAM_CHECK(workSpace != NULL, return -1, "Invaid space");
|
||||
PARAM_CHECK((type == TRIGGER_BOOT) || (type == TRIGGER_PARAM_WATCH), return -1, "Invaid type");
|
||||
PARAM_CHECK(workSpace != NULL, return -1, "Invalid space");
|
||||
PARAM_CHECK((type == TRIGGER_BOOT) || (type == TRIGGER_PARAM_WATCH), return -1, "Invalid type");
|
||||
return ExecTriggerMatch_(workSpace, type, calculator, content, contentSize);
|
||||
}
|
||||
|
||||
static int CheckParamMatch_(const TriggerWorkSpace *workSpace,
|
||||
int type, LogicCalculator *calculator, const char *content, uint32_t contentSize)
|
||||
{
|
||||
PARAM_CHECK(workSpace != NULL, return -1, "Invaid space");
|
||||
PARAM_CHECK((type == TRIGGER_PARAM) || (type == TRIGGER_PARAM_WAIT), return -1, "Invaid type");
|
||||
PARAM_CHECK(workSpace != NULL, return -1, "Invalid space");
|
||||
PARAM_CHECK((type == TRIGGER_PARAM) || (type == TRIGGER_PARAM_WAIT), return -1, "Invalid type");
|
||||
|
||||
CalculatorInit(calculator, MAX_CONDITION_NUMBER, sizeof(LogicData), 1);
|
||||
int ret = GetValueFromContent(content, contentSize, 0, calculator->inputName, SUPPORT_DATA_BUFFER_MAX);
|
||||
@ -427,7 +427,7 @@ static int CheckUnknowMatch_(const TriggerWorkSpace *workSpace,
|
||||
int type, LogicCalculator *calculator, const char *content, uint32_t contentSize)
|
||||
{
|
||||
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);
|
||||
int ret = memcpy_s(calculator->triggerContent, sizeof(calculator->triggerContent), content, contentSize);
|
||||
@ -760,4 +760,4 @@ const char *GetTriggerName(const TriggerNode *trigger)
|
||||
return triggerHead->getTriggerName(trigger);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ ListNode *ListFind(const ListNode *head, void *data, ListTraversalProc comparePr
|
||||
* @brief Traversal the list with specified function
|
||||
*
|
||||
* @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 flags optinal traversing flags:
|
||||
* TRAVERSE_REVERSE_ORDER: traversing from last node to first node;
|
||||
|
Loading…
Reference in New Issue
Block a user