[or-cvs] r16684: {tor} remove a code path that should never happen (and if it did, (tor/trunk/src/common)

arma at seul.org arma at seul.org
Fri Aug 29 09:06:18 UTC 2008


Author: arma
Date: 2008-08-29 05:06:18 -0400 (Fri, 29 Aug 2008)
New Revision: 16684

Modified:
   tor/trunk/src/common/util.c
Log:
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).


Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c	2008-08-28 23:00:32 UTC (rev 16683)
+++ tor/trunk/src/common/util.c	2008-08-29 09:06:18 UTC (rev 16684)
@@ -1702,11 +1702,12 @@
   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);



More information about the tor-commits mailing list