X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_restore.c;h=150f1ee8fd5f53a578d683297386160e1d6e1f40;hb=801ce418130e78b4b6818f2c8af85c3ddae400ff;hp=a0ef6359c1e7be1298832687325521feb2b546c1;hpb=ed81aafcd615bf6d9aa957e4d9957e460508eaf4;p=rrdtool.git diff --git a/src/rrd_restore.c b/src/rrd_restore.c index a0ef635..150f1ee 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -423,8 +423,12 @@ rrd_write(char *file_name, rrd_t *rrd) fwrite(rrd->rra_def, sizeof(rra_def_t), rrd->stat_head->rra_cnt, rrd_file); - - fwrite(rrd->live_head, sizeof(live_head_t),1, rrd_file); + + /* maybe the xml hold an old formatted rrd */ + if (atoi(rrd->stat_head->version) < 3) + fwrite(&(rrd->live_head->last_up), sizeof(long),1, rrd_file); + else + fwrite(rrd->live_head, sizeof(live_head_t),1, rrd_file); fwrite( rrd->pdp_prep, sizeof(pdp_prep_t),rrd->stat_head->ds_cnt,rrd_file);