mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
DataFlash: fix unused result warning
This commit is contained in:
parent
f18e0dadc9
commit
fd87a4f180
@ -861,9 +861,14 @@ uint16_t DataFlash_File::start_new_log(void)
|
||||
|
||||
char buf[30];
|
||||
snprintf(buf, sizeof(buf), "%u\r\n", (unsigned)log_num);
|
||||
write(fd, buf, strlen(buf));
|
||||
const ssize_t to_write = strlen(buf);
|
||||
const ssize_t written = write(fd, buf, to_write);
|
||||
close(fd);
|
||||
|
||||
if (written < to_write) {
|
||||
return 0xFFFF;
|
||||
}
|
||||
|
||||
return log_num;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user