summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-11-08 08:47:19 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-11-08 08:47:19 +0100
commitc0e60d482394f248f9edc627d05a147a09bc5c4c (patch)
treeef55105b18d0d091a7d2042ba5a02e8dc94c0028
parent93ee0d9cb369c12a196632f2212afbba1aec16a2 (diff)
downloadfastd-c0e60d482394f248f9edc627d05a147a09bc5c4c.tar
fastd-c0e60d482394f248f9edc627d05a147a09bc5c4c.zip
Truncate PID file
-rw-r--r--src/fastd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fastd.c b/src/fastd.c
index f479238..eece815 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -964,7 +964,7 @@ static void write_pid(fastd_context *ctx, pid_t pid) {
if (!ctx->conf->pid_file)
return;
- int fd = open(ctx->conf->pid_file, O_WRONLY|O_CREAT, 0666);
+ int fd = open(ctx->conf->pid_file, O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd < 0) {
pr_error_errno(ctx, "can't write PID file: open");
return;