}
}
- void DoAtFork() {
- _W("pid: %d", pid_);
+ void DoAtFork() {
+ _W("pid: %d", pid_);
try {
std::string path = "/run/aul/apps/" + std::to_string(getuid()) + "/" +
- std::to_string(pid_);
+ std::to_string(pid_);
DeleteSocketPath(fs::path(path));
DeleteUnusedFiles();
} catch (const std::filesystem::filesystem_error& e) {
_E("Exception occurs. error(%s:%d)", e.what(), e.code().value());
}
- }
+ }
private:
void DeleteSocketPath(const fs::path& path) {
}
void DeleteUnusedFiles() {
+ DeleteMCJFile();
+ DeleteTmpFiles();
+ }
+
+ void DeleteMCJFile() {
+ std::string path = "/tmp/.dotnet/mcj/MCJ.TMP." + std::to_string(pid_);
+ if (access(path.c_str(), F_OK) == 0) {
+ _W("Remove file: %s", path.c_str());
+ fs::remove(path);
+ }
+ }
+
+ void DeleteTmpFiles() {
std::vector<std::string> files = {
"clr-debug-pipe-" + std::to_string(pid_) + "-",
"dotnet-diagnostic-" + std::to_string(pid_) + "-"
SignalAction(int signo, struct sigaction action)
: signo_(signo), action_(action) {}
- int GetSigno() const { return signo_; };
- struct sigaction GetSigaction() const { return action_; };
+ int GetSigno() const { return signo_; }
+
+ struct sigaction GetSigaction() const {
+ return action_;
+ }
private:
int signo_;