Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/uab/header/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ int mountSelfBundle(const lightElf::native_elf &elf,
}
}

return erofsfuse_main(4, const_cast<char **>(erofs_argv.data()));
_exit(erofsfuse_main(4, const_cast<char **>(erofs_argv.data())));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using _exit is crucial here to prevent the child process from running any further code after erofsfuse_main completes. This avoids potential conflicts or unintended side effects in the parent process's environment. This is especially important in forked processes to avoid shared resource corruption or double freeing of memory.

Consider adding a comment explaining why _exit is used instead of exit or return for clarity.

Suggested change
_exit(erofsfuse_main(4, const_cast<char **>(erofs_argv.data())));
_exit(erofsfuse_main(4, const_cast<char **>(erofs_argv.data()))); // Use _exit to avoid parent process interference

}

int status{ 0 };
Expand Down