param_shmem: do fsync after param write

This commit is contained in:
Julian Oes
2016-04-12 09:10:47 +02:00
parent 015d7431a7
commit 9cfffc9747
@@ -857,7 +857,16 @@ param_save_default(void)
goto exit;
}
// After writing the file, also do a fsync to prevent loosing params if power is cut.
res = fsync(fd);
if (res != 0) {
PX4_ERR("failed to do fsync: %s", strerror(errno));
goto exit;
}
PARAM_CLOSE(fd);
fd = -1;
exit: