From c0e60d482394f248f9edc627d05a147a09bc5c4c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 8 Nov 2012 08:47:19 +0100 Subject: Truncate PID file --- src/fastd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3