mirror of
https://github.com/wiiu-env/libmocha.git
synced 2024-11-25 21:14:16 +01:00
Fix possible race condition in fsa_dirnext
Also some minor line changes to make em match a bit better!
This commit is contained in:
parent
0c624531ca
commit
f3c45c52ad
@ -13,12 +13,11 @@ int __fsa_dirnext(struct _reent *r,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *dir = (__fsa_dir_t *) (dirState->dirStruct);
|
|
||||||
memset(&dir->entry_data, 0, sizeof(dir->entry_data));
|
|
||||||
|
|
||||||
auto *deviceData = (FSADeviceData *) r->deviceData;
|
auto *deviceData = (FSADeviceData *) r->deviceData;
|
||||||
|
auto *dir = (__fsa_dir_t *) (dirState->dirStruct);
|
||||||
|
|
||||||
std::lock_guard<MutexWrapper> lock(dir->mutex);
|
std::lock_guard<MutexWrapper> lock(dir->mutex);
|
||||||
|
memset(&dir->entry_data, 0, sizeof(dir->entry_data));
|
||||||
|
|
||||||
status = FSAReadDir(deviceData->clientHandle, dir->fd, &dir->entry_data);
|
status = FSAReadDir(deviceData->clientHandle, dir->fd, &dir->entry_data);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
|
@ -12,7 +12,6 @@ int __fsa_fsync(struct _reent *r,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto *file = (__fsa_file_t *) fd;
|
auto *file = (__fsa_file_t *) fd;
|
||||||
|
|
||||||
auto *deviceData = (FSADeviceData *) r->deviceData;
|
auto *deviceData = (FSADeviceData *) r->deviceData;
|
||||||
|
|
||||||
std::lock_guard<MutexWrapper> lock(file->mutex);
|
std::lock_guard<MutexWrapper> lock(file->mutex);
|
||||||
|
@ -16,7 +16,6 @@ off_t __fsa_seek(struct _reent *r,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto *file = (__fsa_file_t *) fd;
|
auto *file = (__fsa_file_t *) fd;
|
||||||
|
|
||||||
auto *deviceData = (FSADeviceData *) r->deviceData;
|
auto *deviceData = (FSADeviceData *) r->deviceData;
|
||||||
|
|
||||||
std::lock_guard<MutexWrapper> lock(file->mutex);
|
std::lock_guard<MutexWrapper> lock(file->mutex);
|
||||||
|
@ -14,7 +14,6 @@ int __fsa_ftruncate(struct _reent *r,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto *file = (__fsa_file_t *) fd;
|
auto *file = (__fsa_file_t *) fd;
|
||||||
|
|
||||||
auto *deviceData = (FSADeviceData *) r->deviceData;
|
auto *deviceData = (FSADeviceData *) r->deviceData;
|
||||||
|
|
||||||
std::lock_guard<MutexWrapper> lock(file->mutex);
|
std::lock_guard<MutexWrapper> lock(file->mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user