Remove PID from unnamed buffer swap names.
This commit is contained in:
5
Swap.cc
5
Swap.cc
@@ -530,8 +530,7 @@ SwapManager::ComputeSidecarPath(const Buffer &buf)
|
|||||||
// Unnamed buffers: unique within the process.
|
// Unnamed buffers: unique within the process.
|
||||||
static std::atomic<std::uint64_t> ctr{0};
|
static std::atomic<std::uint64_t> ctr{0};
|
||||||
const std::uint64_t n = ++ctr;
|
const std::uint64_t n = ++ctr;
|
||||||
const int pid = (int) ::getpid();
|
const std::string name = "unnamed-" + std::to_string(n) + ".swp";
|
||||||
const std::string name = "unnamed-" + std::to_string(pid) + "-" + std::to_string(n) + ".swp";
|
|
||||||
return (root / name).string();
|
return (root / name).string();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1296,4 +1295,4 @@ SwapManager::ReplayFile(Buffer &buf, const std::string &swap_path, std::string &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace kte
|
} // namespace kte
|
||||||
Reference in New Issue
Block a user