提交 3f790442 编写于 作者: L lifeng68

lcr: remove NOTIFY_SOCKET env when do fork

Signed-off-by: Nlifeng68 <lifeng68@huawei.com>
上级 62664adf
......@@ -430,7 +430,7 @@ bool lcr_start(const struct lcr_start_request *request)
}
pid = fork();
if (pid == (pid_t) - 1) {
if (pid == (pid_t) -1) {
ERROR("Failed to fork()\n");
close(pipefd[0]);
close(pipefd[1]);
......@@ -438,6 +438,7 @@ bool lcr_start(const struct lcr_start_request *request)
}
if (pid == (pid_t)0) {
(void)unsetenv("NOTIFY_SOCKET");
// child process, dup2 pipefd[1] to stderr
close(pipefd[0]);
dup2(pipefd[1], 2);
......
......@@ -665,7 +665,7 @@ bool do_attach(const char *name, const char *path, const struct lcr_exec_request
}
pid = fork();
if (pid == (pid_t) - 1) {
if (pid == (pid_t) -1) {
ERROR("Failed to fork()\n");
close(pipefd[0]);
close(pipefd[1]);
......@@ -673,6 +673,7 @@ bool do_attach(const char *name, const char *path, const struct lcr_exec_request
}
if (pid == (pid_t)0) {
(void)unsetenv("NOTIFY_SOCKET");
if (lcr_util_null_stdfds() < 0) {
COMMAND_ERROR("Failed to close fds");
exit(EXIT_FAILURE);
......
......@@ -46,7 +46,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
std::vector<std::string> ret_vec;
std::string tmpstr;
std::istringstream istr(testData);
while(std::getline(istr, tmpstr, ',')) {
while (std::getline(istr, tmpstr, ',')) {
ret_vec.push_back(tmpstr);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册