mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Replace remaining fprintf with tfm::format manually
This commit is contained in:
@@ -108,14 +108,13 @@ static fs::path GetPidFile()
|
||||
|
||||
NODISCARD static bool CreatePidFile()
|
||||
{
|
||||
FILE* file = fsbridge::fopen(GetPidFile(), "w");
|
||||
fsbridge::ofstream file{GetPidFile()};
|
||||
if (file) {
|
||||
#ifdef WIN32
|
||||
fprintf(file, "%d\n", GetCurrentProcessId());
|
||||
tfm::format(file, "%d\n", GetCurrentProcessId());
|
||||
#else
|
||||
fprintf(file, "%d\n", getpid());
|
||||
tfm::format(file, "%d\n", getpid());
|
||||
#endif
|
||||
fclose(file);
|
||||
return true;
|
||||
} else {
|
||||
return InitError(strprintf(_("Unable to create the PID file '%s': %s"), GetPidFile().string(), std::strerror(errno)));
|
||||
|
||||
Reference in New Issue
Block a user