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

Changing return to _exit() in the child process is crucial for correct process termination. Using _exit() ensures that the child process terminates immediately without invoking atexit handlers or C++ destructors, which can lead to unexpected behavior or deadlocks in a forked process that does not call exec(). This is a best practice for child processes created via fork().

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

}

int status{ 0 };
Expand Down