summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-04-15 16:10:41 -0400
committerAaron <aaron@10gen.com>2009-04-15 16:10:41 -0400
commit9e6d8a769d9e13259f6e2c77db13423e87d758a9 (patch)
tree4c545e25e414bbd40dafeea57073228f917d7e5b
parente8c1ce4dc12a841a8e64b3f748c07fc3354ebe01 (diff)
downloadmongo-9e6d8a769d9e13259f6e2c77db13423e87d758a9.tar.gz
Revert "Revert "abort allocation on failed write""
This reverts commit 9ccebf3f4c00543809d8951b803ae2dd93b9db35.
-rw-r--r--util/file_allocator.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/file_allocator.h b/util/file_allocator.h
index 14e9aee9c9c..e81de1834a6 100644
--- a/util/file_allocator.h
+++ b/util/file_allocator.h
@@ -158,10 +158,10 @@ namespace mongo {
int left = size;
while ( 1 ) {
if ( left <= z ) {
- write(fd, buf, left);
+ massert( "write failed", left == write(fd, buf, left) );
break;
}
- write(fd, buf, z);
+ massert( "write failed", z == write(fd, buf, z) );
left -= z;
}
log() << "done allocating datafile " << name << ", size: " << size << ", took " << ((double)t.millis())/1000.0 << " secs" << endl;