diff options
author | Aaron <aaron@10gen.com> | 2009-04-15 16:10:41 -0400 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2009-04-15 16:10:41 -0400 |
commit | 9e6d8a769d9e13259f6e2c77db13423e87d758a9 (patch) | |
tree | 4c545e25e414bbd40dafeea57073228f917d7e5b /util | |
parent | e8c1ce4dc12a841a8e64b3f748c07fc3354ebe01 (diff) | |
download | mongo-9e6d8a769d9e13259f6e2c77db13423e87d758a9.tar.gz |
Revert "Revert "abort allocation on failed write""
This reverts commit 9ccebf3f4c00543809d8951b803ae2dd93b9db35.
Diffstat (limited to 'util')
-rw-r--r-- | util/file_allocator.h | 4 |
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; |