提交 98dd0375 编写于 作者: X xionglei6

int: fix codedex

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
上级 ea6149e7
......@@ -47,7 +47,7 @@ static int main_cmd(BShellHandle shell, int argc, char **argv)
} else if (strcmp(argv[0], "stop") == 0) {
ServiceControlWithExtra(argv[1], 1, (const char **)argv + SERVICE_START_NUMBER, argc - SERVICE_START_NUMBER);
} else if (strcmp(argv[0], "timer_start") == 0) {
if (argc < 2) {
if (argc < SERVICE_START_NUMBER) {
return -1;
}
char *timeBuffer = argv[SERVICE_START_NUMBER];
......
......@@ -432,9 +432,7 @@ void ServiceReap(Service *service)
// If the service set timer
// which means the timer handler will start the service
// Init should not start it automatically.
if (IsServiceWithTimerEnabled(service)) {
return;
}
INIT_CHECK(IsServiceWithTimerEnabled(service) == 0, return);
if (!IsOnDemandService(service)) {
CloseServiceSocket(service);
......@@ -481,9 +479,7 @@ void ServiceReap(Service *service)
INIT_CHECK_ONLY_ELOG(ret == SERVICE_SUCCESS, "Failed to exec restartArg for %s", service->name);
}
ret = ServiceStart(service);
if (ret != SERVICE_SUCCESS) {
INIT_LOGE("reap service %s start failed!", service->name);
}
INIT_CHECK_ONLY_ELOG(ret == SERVICE_SUCCESS, "reap service %s start failed!", service->name);
service->attribute &= (~SERVICE_ATTR_NEED_RESTART);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册