1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-22 02:20:51 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-12-24 20:15:17 +09:00
parent 71125735ac
commit 8e29c83647
2 changed files with 8 additions and 1 deletions

View File

@ -670,9 +670,13 @@ static u32 get_umask() {
return mask;
}
void sigint_handler(int s) {
void cleanup() {
if (output_tmpfile)
unlink(output_tmpfile);
}
static void sigint_handler(int) {
cleanup();
_exit(1);
}

3
mold.h
View File

@ -81,10 +81,13 @@ struct Config {
inline Config config;
void cleanup();
[[noreturn]] inline void error(std::string msg) {
static std::mutex mu;
std::lock_guard lock(mu);
std::cerr << msg << "\n" << std::flush;
cleanup();
_exit(1);
}