|
|
|
@ -857,7 +857,16 @@ param_save_default(void)
@@ -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: |
|
|
|
|