未验证 提交 791227e2 编写于 作者: O openharmony_ci 提交者: Gitee

!620 统一L1 、L2 execv 命令执行统一,将 环境变量设置,改为在 init.cfg 文件中添加export

Merge pull request !620 from hw_mzyan/OpenHarmony-3.0-LTS
......@@ -207,9 +207,10 @@ int ServiceStart(Service *service)
INIT_CHECK_ONLY_ELOG(execv(service->pathArgs[0], service->pathArgs) == 0,
"service %s execve failed! err %d.", service->name, errno);
#else
char* env[] = {"LD_LIBRARY_PATH=/storage/app/libs", NULL};
INIT_CHECK_ONLY_ELOG(execve(service->pathArgs[0], service->pathArgs, env) == 0,
"service %s execve failed! err %d.", service->name, errno);
if (execv(service->pathArgs[0], service->pathArgs) != 0) {
INIT_LOGE("service %s execv failed! err %d.", service->name, errno);
return errno;
}
#endif
_exit(0x7f); // 0x7f: user specified
} else if (pid < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册