unix/{Daemon,PidFile}: throw exception on error

Don't use the bad `FatalError` library.
This commit is contained in:
Max Kellermann
2018-08-01 20:20:29 +02:00
parent 95acc4be07
commit dfda0faac7
3 changed files with 25 additions and 26 deletions

View File

@@ -22,7 +22,7 @@
#include "fs/FileSystem.hxx"
#include "fs/AllocatedPath.hxx"
#include "Log.hxx"
#include "system/Error.hxx"
#include <assert.h>
#include <string.h>
@@ -41,8 +41,8 @@ public:
fd = OpenFile(path, O_WRONLY|O_CREAT|O_TRUNC, 0666).Steal();
if (fd < 0) {
const std::string utf8 = path.ToUTF8();
FormatFatalSystemError("Failed to create pid file \"%s\"",
utf8.c_str());
throw FormatErrno("Failed to create pid file \"%s\"",
utf8.c_str());
}
}