mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-02 08:42:15 +00:00
Misc fixes
This commit is contained in:
parent
070e1012b8
commit
65b7ac9039
2 changed files with 7 additions and 7 deletions
|
@ -49,7 +49,7 @@ namespace sts::ncm::impl {
|
|||
|
||||
if (found_cache) {
|
||||
/* Flush and close */
|
||||
fsync(fileno(found_cache->handle));
|
||||
fflush(found_cache->handle));
|
||||
fclose(found_cache->handle);
|
||||
std::fill(found_cache->id.uuid, found_cache->id.uuid + sizeof(PlaceHolderId), 0);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ namespace sts::ncm::impl {
|
|||
|
||||
/* Find an empty cache */
|
||||
for (size_t i = 0; i < MaxCaches; i++) {
|
||||
if (placeholder_id != InvalidUuid) {
|
||||
if (placeholder_id == InvalidUuid) {
|
||||
cache = &this->caches[i];
|
||||
break;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ namespace sts::ncm::impl {
|
|||
|
||||
/* Flush and close any handles. */
|
||||
if (cache->handle) {
|
||||
fsync(fileno(cache->handle));
|
||||
fflush(cache->handle);
|
||||
fclose(cache->handle);
|
||||
}
|
||||
cache->id = InvalidUuid;
|
||||
|
@ -226,7 +226,7 @@ namespace sts::ncm::impl {
|
|||
CacheEntry* cache = &this->caches[i];
|
||||
|
||||
if (cache->id != InvalidUuid) {
|
||||
fsync(fileno(cache->handle));
|
||||
fflush(cache->handle));
|
||||
fclose(cache->handle);
|
||||
cache->id = InvalidUuid;
|
||||
}
|
||||
|
|
|
@ -163,8 +163,8 @@ namespace sts::ncm {
|
|||
fseek(f, offset, SEEK_SET);
|
||||
fwrite(data.buffer, sizeof(u8), data.num_elements, f);
|
||||
|
||||
if (this->placeholder_accessor.delay_flush ^ 1) {
|
||||
fsync(fileno(f));
|
||||
if (!this->placeholder_accessor.delay_flush) {
|
||||
fflush(f));
|
||||
}
|
||||
|
||||
this->placeholder_accessor.FlushCache(f, placeholder_id);
|
||||
|
@ -598,7 +598,7 @@ namespace sts::ncm {
|
|||
|
||||
fseek(f, offset, SEEK_SET);
|
||||
fwrite(data.buffer, sizeof(u8), data.num_elements, f);
|
||||
fsync(fileno(f));
|
||||
fflush(f));
|
||||
|
||||
if (errno != 0) {
|
||||
return fsdevGetLastResult();
|
||||
|
|
Loading…
Reference in a new issue