Remove PID from unnamed buffer swap names.

This commit is contained in:
2026-02-17 17:17:55 -08:00
parent b0b5b55dce
commit a21409e689

View File

@@ -530,8 +530,7 @@ SwapManager::ComputeSidecarPath(const Buffer &buf)
// Unnamed buffers: unique within the process.
static std::atomic<std::uint64_t> ctr{0};
const std::uint64_t n = ++ctr;
const int pid = (int) ::getpid();
const std::string name = "unnamed-" + std::to_string(pid) + "-" + std::to_string(n) + ".swp";
const std::string name = "unnamed-" + std::to_string(n) + ".swp";
return (root / name).string();
}
@@ -1296,4 +1295,4 @@ SwapManager::ReplayFile(Buffer &buf, const std::string &swap_path, std::string &
}
}
}
} // namespace kte
} // namespace kte