ntfs: gcc2 build fixes.

This commit is contained in:
Jérôme Duval 2018-07-08 19:29:31 +02:00
parent 65e832b71a
commit de2ba86e5e
2 changed files with 8 additions and 4 deletions

View File

@ -533,10 +533,11 @@ fs_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
size = na->data_size - pos; size = na->data_size - pos;
while (size > 0) { while (size > 0) {
s64 bytesRead;
s64 sizeToRead = size; s64 sizeToRead = size;
if (tempBuffer != NULL && size > TEMP_BUFFER_SIZE) if (tempBuffer != NULL && size > TEMP_BUFFER_SIZE)
sizeToRead = TEMP_BUFFER_SIZE; sizeToRead = TEMP_BUFFER_SIZE;
s64 bytesRead = ntfs_attr_pread(na, pos, sizeToRead, bytesRead = ntfs_attr_pread(na, pos, sizeToRead,
tempBuffer != NULL ? tempBuffer : (void*)buffer); tempBuffer != NULL ? tempBuffer : (void*)buffer);
if (bytesRead <= 0) { if (bytesRead <= 0) {
*len = 0; *len = 0;
@ -646,6 +647,7 @@ fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
} }
while (size > 0) { while (size > 0) {
s64 bytesWritten;
s64 sizeToWrite = size; s64 sizeToWrite = size;
if (tempBuffer != NULL) { if (tempBuffer != NULL) {
if (size > TEMP_BUFFER_SIZE) if (size > TEMP_BUFFER_SIZE)
@ -655,7 +657,7 @@ fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
goto exit; goto exit;
} }
} }
s64 bytesWritten = ntfs_attr_pwrite(na, pos, sizeToWrite, bytesWritten = ntfs_attr_pwrite(na, pos, sizeToWrite,
tempBuffer != NULL ? tempBuffer : (void*)buffer); tempBuffer != NULL ? tempBuffer : (void*)buffer);
if (bytesWritten <= 0) { if (bytesWritten <= 0) {
ERROR("%s - ntfs_attr_pwrite()<=0\n", __FUNCTION__); ERROR("%s - ntfs_attr_pwrite()<=0\n", __FUNCTION__);

View File

@ -1242,10 +1242,11 @@ fs_read(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t offset, void *buf
} }
while (size > 0) { while (size > 0) {
s64 bytesRead;
s64 sizeToRead = size; s64 sizeToRead = size;
if (tempBuffer != NULL && size > TEMP_BUFFER_SIZE) if (tempBuffer != NULL && size > TEMP_BUFFER_SIZE)
sizeToRead = TEMP_BUFFER_SIZE; sizeToRead = TEMP_BUFFER_SIZE;
s64 bytesRead = ntfs_attr_pread(na, offset, sizeToRead, bytesRead = ntfs_attr_pread(na, offset, sizeToRead,
tempBuffer != NULL ? tempBuffer : (void*)buffer); tempBuffer != NULL ? tempBuffer : (void*)buffer);
if (bytesRead <= 0) { if (bytesRead <= 0) {
*len = 0; *len = 0;
@ -1362,6 +1363,7 @@ fs_write(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t offset,
} }
while (size > 0) { while (size > 0) {
s64 bytesWritten;
s64 sizeToWrite = size; s64 sizeToWrite = size;
if (tempBuffer != NULL) { if (tempBuffer != NULL) {
if (size > TEMP_BUFFER_SIZE) if (size > TEMP_BUFFER_SIZE)
@ -1371,7 +1373,7 @@ fs_write(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t offset,
goto exit; goto exit;
} }
} }
s64 bytesWritten = ntfs_attr_pwrite(na, offset, sizeToWrite, bytesWritten = ntfs_attr_pwrite(na, offset, sizeToWrite,
tempBuffer != NULL ? tempBuffer : (void*)buffer); tempBuffer != NULL ? tempBuffer : (void*)buffer);
if (bytesWritten <= 0) { if (bytesWritten <= 0) {
ERROR("fs_write - ntfs_attr_pwrite()<=0\n"); ERROR("fs_write - ntfs_attr_pwrite()<=0\n");