diff options
| author | MarcoFalke <[email protected]> | 2019-06-13 09:43:24 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2019-06-18 15:50:40 -0400 |
| commit | 79745d1752d0d1a95f073a04d6f4b9715745cf17 (patch) | |
| tree | 21de08b84a5a1d87ea1322a2f9e9cbec1a75e138 /src/init.cpp | |
| parent | scripted-diff: Replace fprintf with tfm::format (diff) | |
| download | discoin-79745d1752d0d1a95f073a04d6f4b9715745cf17.tar.xz discoin-79745d1752d0d1a95f073a04d6f4b9715745cf17.zip | |
Replace remaining fprintf with tfm::format manually
Github-Pull: #16205
Rebased-From: fa8f195195945ce6258199af0461e3fbfbc1236d
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp index 1ed44821e..557102efc 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -106,14 +106,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))); |