fs/FileSystem: RemoveFile() throws exception on error

This commit is contained in:
Max Kellermann
2016-08-15 22:25:15 +02:00
parent 14d3da0e18
commit ea0e6d9824
8 changed files with 48 additions and 22 deletions

View File

@@ -22,7 +22,10 @@
#include "system/FatalError.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/FileSystem.hxx"
#ifndef WIN32
#include "PidFile.hxx"
#endif
#include <stdlib.h>
#include <unistd.h>
@@ -247,7 +250,7 @@ void
daemonize_finish(void)
{
if (!pidfile.IsNull()) {
RemoveFile(pidfile);
unlink(pidfile.c_str());
pidfile = AllocatedPath::Null();
}

View File

@@ -64,7 +64,7 @@ public:
assert(!path.IsNull());
close(fd);
RemoveFile(path);
unlink(path.c_str());
}
void Write(pid_t pid) {