DataFlash: fix unused result warning

This commit is contained in:
Peter Barker 2016-08-25 13:57:58 +10:00 committed by Andrew Tridgell
parent f18e0dadc9
commit fd87a4f180

View File

@ -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;
}