diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-11-08 08:47:19 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-11-08 08:47:19 +0100 |
commit | c0e60d482394f248f9edc627d05a147a09bc5c4c (patch) | |
tree | ef55105b18d0d091a7d2042ba5a02e8dc94c0028 | |
parent | 93ee0d9cb369c12a196632f2212afbba1aec16a2 (diff) | |
download | fastd-c0e60d482394f248f9edc627d05a147a09bc5c4c.tar fastd-c0e60d482394f248f9edc627d05a147a09bc5c4c.zip |
Truncate PID file
-rw-r--r-- | src/fastd.c | 2 |
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; |