]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
remove a code path that should never happen (and if it did, we'd be
authorRoger Dingledine <arma@torproject.org>
Fri, 29 Aug 2008 09:06:18 +0000 (09:06 +0000)
committerRoger Dingledine <arma@torproject.org>
Fri, 29 Aug 2008 09:06:18 +0000 (09:06 +0000)
complaining about an errno set from some arbitrary previous problem).

svn:r16684

src/common/util.c

index 102220de801554c294fd50db3f189573001cb48b..701e1b8f9448ae57fa7913e6fb41e0ddfdf76ccc 100644 (file)
@@ -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);