diff --git a/libraries/libstratosphere/include/stratosphere/fssystem/buffers/fssystem_buffer_manager_utils.hpp b/libraries/libstratosphere/include/stratosphere/fssystem/buffers/fssystem_buffer_manager_utils.hpp index db1e01bce..e68998605 100644 --- a/libraries/libstratosphere/include/stratosphere/fssystem/buffers/fssystem_buffer_manager_utils.hpp +++ b/libraries/libstratosphere/include/stratosphere/fssystem/buffers/fssystem_buffer_manager_utils.hpp @@ -37,8 +37,7 @@ namespace ams::fssystem::buffers { } R_TRY(on_failure()); - /* TODO: os::SleepThread */ - svc::SleepThread(impl::RetryWait.GetNanoSeconds()); + os::SleepThread(impl::RetryWait); continue; } diff --git a/libraries/libstratosphere/source/fs/fs_content_storage.cpp b/libraries/libstratosphere/source/fs/fs_content_storage.cpp index 5e778eb3c..f04f35a7f 100644 --- a/libraries/libstratosphere/source/fs/fs_content_storage.cpp +++ b/libraries/libstratosphere/source/fs/fs_content_storage.cpp @@ -60,22 +60,25 @@ namespace ams::fs { /* It can take some time for the system partition to be ready (if it's on the SD card). */ /* Thus, we will retry up to 10 times, waiting one second each time. */ - constexpr size_t MaxRetries = 10; - constexpr u64 RetryInterval = 1'000'000'000ul; + constexpr size_t MaxRetries = 10; + constexpr auto RetryInterval = TimeSpan::FromSeconds(1); /* Mount the content storage, use libnx bindings. */ ::FsFileSystem fs; for (size_t i = 0; i < MaxRetries; i++) { + /* Try to open the filesystem. */ R_TRY_CATCH(fsOpenContentStorageFileSystem(std::addressof(fs), static_cast<::FsContentStorageId>(id))) { R_CATCH(fs::ResultSystemPartitionNotReady) { if (i < MaxRetries - 1) { - /* TODO: os::SleepThread */ - svcSleepThread(RetryInterval); + os::SleepThread(RetryInterval); } else { return fs::ResultSystemPartitionNotReady(); } } } R_END_TRY_CATCH; + + /* The filesystem was opened successfully. */ + break; } /* Allocate a new filesystem wrapper. */ diff --git a/libraries/libstratosphere/source/fssystem/fssystem_pooled_buffer.cpp b/libraries/libstratosphere/source/fssystem/fssystem_pooled_buffer.cpp index df32ec50a..7d36e9919 100644 --- a/libraries/libstratosphere/source/fssystem/fssystem_pooled_buffer.cpp +++ b/libraries/libstratosphere/source/fssystem/fssystem_pooled_buffer.cpp @@ -145,8 +145,7 @@ namespace ams::fssystem { break; } else { /* Sleep. */ - /* TODO: os::SleepThread() */ - svc::SleepThread(RetryWait.GetNanoSeconds()); + os::SleepThread(RetryWait); g_retry_count++; } }