Replace remaining fprintf with tfm::format manually

This commit is contained in:
MarcoFalke
2019-06-13 09:43:24 -04:00
parent fac03ec43a
commit fa8f195195
6 changed files with 9 additions and 11 deletions

View File

@@ -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)));