From bcc3f0b534c895deb1cbd28309f8c2dc6972a91f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 5 Aug 2016 12:53:37 +0200 Subject: Fix reexec bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/coopgammad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coopgammad.c b/src/coopgammad.c index 5f18814..83352e0 100644 --- a/src/coopgammad.c +++ b/src/coopgammad.c @@ -604,7 +604,7 @@ static char* reexecute(void) goto fail; } - fd = open(statefile, O_CREAT, S_IRUSR | S_IWUSR); + fd = open(statefile, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if (fd < 0) goto fail; -- cgit v1.2.3-70-g09d2