mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 1a274bce4b into merged_master (Bitcoin PR #16205)
This commit is contained in:
commit
e33ff205ee
14 changed files with 67 additions and 68 deletions
|
|
@ -114,14 +114,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)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue