From 95a4f3326515b98c2f7be1982254a5e6edd2fa07 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 12 Dec 2016 14:39:56 +0100 Subject: [PATCH] sourcestats: save asymmetry run in dump files This allows the asymmetry correction to be applied right after restart. --- sourcestats.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sourcestats.c b/sourcestats.c index eecd232..166038d 100644 --- a/sourcestats.c +++ b/sourcestats.c @@ -844,6 +844,8 @@ SST_SaveToFile(SST_Stats inst, FILE *out) inst->strata[j]); } + + fprintf(out, "%d\n", inst->asymmetry_run); } /* ================================================== */ @@ -898,6 +900,10 @@ SST_LoadFromFile(SST_Stats inst, FILE *in) UTI_NormaliseTimespec(&inst->sample_times[i]); } } + + /* This field was not saved in older versions */ + if (!fgets(line, sizeof(line), in) || sscanf(line, "%d\n", &inst->asymmetry_run) != 1) + inst->asymmetry_run = 0; } else { inst->n_samples = 0; /* Load abandoned if any sign of corruption */ return 0;