comparison src/lib-storage/index/dbox-common/dbox-file.c @ 14682:d0d7b810646b

Make sure we check all the functions' return values. Minor API changes to simplify this. Checked using a patched clang that adds attribute(warn_unused_result) to all functions. This commit fixes several error handling mistakes.
author Timo Sirainen <tss@iki.fi>
date Mon, 25 Jun 2012 01:14:03 +0300
parents ca37d1577291
children 1b46c1bf9d1e
comparison
equal deleted inserted replaced
14681:ca37d1577291 14682:d0d7b810646b
599 if (st.st_size < file->msg_header_size) { 599 if (st.st_size < file->msg_header_size) {
600 dbox_file_set_corrupted(file, 600 dbox_file_set_corrupted(file,
601 "dbox file size too small"); 601 "dbox file size too small");
602 return 0; 602 return 0;
603 } 603 }
604 o_stream_seek(ctx->output, st.st_size); 604 if (o_stream_seek(ctx->output, st.st_size) < 0) {
605 dbox_file_set_syscall_error(file, "lseek()");
606 return -1;
607 }
605 } 608 }
606 *output_r = ctx->output; 609 *output_r = ctx->output;
607 return 1; 610 return 1;
608 } 611 }
609 612