aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-08-05 12:53:37 +0200
committerMattias Andrée <maandree@kth.se>2016-08-05 12:53:37 +0200
commitbcc3f0b534c895deb1cbd28309f8c2dc6972a91f (patch)
treeb98bd71edc77968a4385ce0ef51ad78abaa41287
parentIn case re-exec fails (diff)
downloadcoopgammad-bcc3f0b534c895deb1cbd28309f8c2dc6972a91f.tar.gz
coopgammad-bcc3f0b534c895deb1cbd28309f8c2dc6972a91f.tar.bz2
coopgammad-bcc3f0b534c895deb1cbd28309f8c2dc6972a91f.tar.xz
Fix reexec bug
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--src/coopgammad.c2
1 files changed, 1 insertions, 1 deletions
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;