Skip to content

Commit 745a2ac

Browse files
committed
Improve PID file removing errors logging
1 parent 5e0c0fd commit 745a2ac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/init.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,11 @@ void Shutdown(InitInterfaces& interfaces)
262262

263263
#ifndef WIN32
264264
try {
265-
fs::remove(GetPidFile());
265+
if (!fs::remove(GetPidFile())) {
266+
LogPrintf("%s: Unable to remove PID file: File does not exist\n", __func__);
267+
}
266268
} catch (const fs::filesystem_error& e) {
267-
LogPrintf("%s: Unable to remove pidfile: %s\n", __func__, e.what());
269+
LogPrintf("%s: Unable to remove PID file: %s\n", __func__, e.what());
268270
}
269271
#endif
270272
interfaces.chain_clients.clear();

0 commit comments

Comments
 (0)