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:
@@ -909,6 +909,7 @@ Inode::WriteAt(Transaction *transaction,off_t pos,const uint8 *buffer,size_t *_l
|
|||||||
status_t
|
status_t
|
||||||
Inode::FillGapWithZeros(off_t pos, off_t newSize)
|
Inode::FillGapWithZeros(off_t pos, off_t newSize)
|
||||||
{
|
{
|
||||||
|
// ToDo: we currently do anything here, same as original BFS!
|
||||||
//if (pos >= newSize)
|
//if (pos >= newSize)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
@@ -940,7 +941,8 @@ Inode::FillGapWithZeros(off_t pos,off_t newSize)
|
|||||||
bytesWritten = length;
|
bytesWritten = length;
|
||||||
|
|
||||||
memset(block + (pos % blockSize), 0, bytesWritten);
|
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;
|
pos += bytesWritten;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user