aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-18 14:38:59 +0200
committerMattias Andrée <maandree@kth.se>2016-07-18 14:38:59 +0200
commit8494c1c0a207c3c4aa46f654c5f08238e1507d31 (patch)
tree280605864a95e25b146f43f5ac88bb8d9aae9987 /src
parentbug fix (diff)
downloadcoopgammad-8494c1c0a207c3c4aa46f654c5f08238e1507d31.tar.gz
coopgammad-8494c1c0a207c3c4aa46f654c5f08238e1507d31.tar.bz2
coopgammad-8494c1c0a207c3c4aa46f654c5f08238e1507d31.tar.xz
bug fix
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/coopgammad.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/coopgammad.c b/src/coopgammad.c
index 8cbc616..48891a4 100644
--- a/src/coopgammad.c
+++ b/src/coopgammad.c
@@ -537,16 +537,15 @@ static int unmarshal_and_merge_state(const char* restrict statefile)
fd = open(statefile, O_RDONLY);
if (fd < 0)
goto fail;
+
+ old_outputs = outputs, outputs = NULL;
+ old_outputs_n = outputs_n, outputs_n = 0;
+
if (!(marshalled = nread(fd, &n)))
goto fail;
close(fd), fd = -1;
unlink(statefile), statefile = NULL;
- old_outputs = outputs;
- old_outputs_n = outputs_n;
- outputs = NULL;
- outputs_n = 0;
-
r = unmarshal(marshalled);
if (r == 0)
goto fail;