aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-08-29 09:06:18 +0000
committerRoger Dingledine <arma@torproject.org>2008-08-29 09:06:18 +0000
commit4eab76f07407bff7555ca0f11be584c7f4dfd106 (patch)
treeba4368b0139dac40067321601ab3e941dcf2e76d
parent5474a0085b931a3d21c53c3151f0d8c4a95e4c70 (diff)
downloadtor-4eab76f07407bff7555ca0f11be584c7f4dfd106.tar
tor-4eab76f07407bff7555ca0f11be584c7f4dfd106.tar.gz
remove a code path that should never happen (and if it did, we'd be
complaining about an errno set from some arbitrary previous problem). svn:r16684
-rw-r--r--src/common/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 102220de8..701e1b8f9 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1702,11 +1702,12 @@ write_chunks_to_file_impl(const char *fname, const smartlist_t *chunks,
SMARTLIST_FOREACH(chunks, sized_chunk_t *, chunk,
{
result = write_all(fd, chunk->bytes, chunk->len, 0);
- if (result < 0 || (size_t)result != chunk->len) {
+ if (result < 0) {
log(LOG_WARN, LD_FS, "Error writing to \"%s\": %s", fname,
strerror(errno));
goto err;
}
+ tor_assert((size_t)result == chunk->len);
});
return finish_writing_to_file(file);