mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
sd_bench: print errno on write failure
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <px4_platform_common/px4_config.h>
|
#include <px4_platform_common/px4_config.h>
|
||||||
#include <px4_platform_common/module.h>
|
#include <px4_platform_common/module.h>
|
||||||
@@ -226,7 +227,7 @@ void write_test(int fd, sdb_config_t *cfg, uint8_t *block, int block_size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((int)written != block_size) {
|
if ((int)written != block_size) {
|
||||||
PX4_ERR("Write error");
|
PX4_ERR("Write error: %d", errno);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user