From 8923664f3052dbada7f613e18c9c954eb7ec8dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 24 Jul 2017 13:13:37 +0200 Subject: [PATCH] param: seek to the beginning of the file before re-trying a failed export attempt --- src/modules/systemlib/param/param.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/systemlib/param/param.c b/src/modules/systemlib/param/param.c index cb0d7c1241..28340107d3 100644 --- a/src/modules/systemlib/param/param.c +++ b/src/modules/systemlib/param/param.c @@ -947,6 +947,10 @@ param_save_default(void) while (res != OK && attempts > 0) { res = param_export(fd, false); attempts--; + + if (res != OK) { + lseek(fd, 0, SEEK_SET); // jump back to the beginning of the file + } } if (res != OK) {