aboutsummaryrefslogtreecommitdiffstats
path: root/src/PidFile.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/PidFile.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/PidFile.hxx b/src/PidFile.hxx
index c06ed6b61..a242c7810 100644
--- a/src/PidFile.hxx
+++ b/src/PidFile.hxx
@@ -47,6 +47,25 @@ public:
PidFile(const PidFile &) = delete;
+ void Close() {
+ if (file == nullptr)
+ return;
+
+ fclose(file);
+ }
+
+ void Delete(const AllocatedPath &path) {
+ if (file == nullptr) {
+ assert(path.IsNull());
+ return;
+ }
+
+ assert(!path.IsNull());
+
+ fclose(file);
+ RemoveFile(path);
+ }
+
void Write(pid_t pid) {
if (file == nullptr)
return;