Check return values from some syscalls and warn if they fail

This commit is contained in:
David Leadbeater 2014-07-06 21:52:03 +01:00
commit dac67a567d
3 changed files with 14 additions and 5 deletions

View file

@ -107,7 +107,9 @@ static int write_buffer_flush_rec(void *handlep, BUFFER_REC *rec)
for (tmp = rec->blocks; tmp != NULL; tmp = tmp->next) {
size = tmp->data != rec->active_block ? BUFFER_BLOCK_SIZE :
rec->active_block_pos;
write(handle, tmp->data, size);
if (write(handle, tmp->data, size) != size) {
g_warning("Failed to write(): %s", strerror(errno));
}
}
empty_blocks = g_slist_concat(empty_blocks, rec->blocks);