Skip to content
Snippets Groups Projects
Commit f8ceee0c authored by Beat Küng's avatar Beat Küng
Browse files

fix param: need to use fsync() and not px4_fsync()

It's used with real OS FD's.
parent f962e982
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@
#include "tinybson.h"
#if 0
# define debug(fmt, args...) do { warnx("BSON: " fmt, ##args); } while(0)
# define debug(fmt, args...) do { PX4_INFO("BSON: " fmt, ##args); } while(0)
#else
# define debug(fmt, args...) do { } while(0)
#endif
......@@ -56,7 +56,7 @@
#define BSON_READ read
#define BSON_WRITE write
#define BSON_FSYNC px4_fsync
#define BSON_FSYNC fsync
static int
read_x(bson_decoder_t decoder, void *p, size_t s)
......
......@@ -1140,14 +1140,14 @@ param_export(int fd, bool only_unsaved)
out:
if (result == 0) {
result = bson_encoder_fini(&encoder); // this will call fsync
result = bson_encoder_fini(&encoder);
// write and finish
if ((result != 0) || write(fd, encoder.buf, encoder.bufpos) != encoder.bufpos) {
PX4_ERR("param write error");
} else {
px4_fsync(fd);
fsync(fd);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment