Added a missing check of the return value of a cached write in
Inode::FillGapWithZeros(), pointed out by Mike Nordell. Note, that function is currently not used. Some smaller cleanups. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1058 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
502d10e3ff
commit
fb34ad79d7
@ -909,6 +909,7 @@ Inode::WriteAt(Transaction *transaction,off_t pos,const uint8 *buffer,size_t *_l
|
||||
status_t
|
||||
Inode::FillGapWithZeros(off_t pos, off_t newSize)
|
||||
{
|
||||
// ToDo: we currently do anything here, same as original BFS!
|
||||
//if (pos >= newSize)
|
||||
return B_OK;
|
||||
|
||||
@ -940,7 +941,8 @@ Inode::FillGapWithZeros(off_t pos,off_t newSize)
|
||||
bytesWritten = length;
|
||||
|
||||
memset(block + (pos % blockSize), 0, bytesWritten);
|
||||
fVolume->WriteBlocks(cached.BlockNumber(),block,1);
|
||||
if (fVolume->WriteBlocks(cached.BlockNumber(), block, 1) < B_OK)
|
||||
RETURN_ERROR(B_IO_ERROR);
|
||||
|
||||
pos += bytesWritten;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user