diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2017-02-26 12:17:12 +0100 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2017-02-26 12:19:57 +0100 |
| commit | 31ebe9b080fbe1361a99ab427bb20251563f9727 (patch) | |
| tree | 65e0970a2f9094031dee119e363c5c66d63650d9 /Source/Core | |
| parent | e9850382e3d5d4669aaf7a58d7660f6290a0d291 (diff) | |
IOS: Clear the /tmp directory on IOS boot
The /tmp directory is cleared every time IOS boots up (when the FS
driver is initialized), *not* when /dev/fs is opened.
Although this should have no effect, it fixes the case where files
could be left in /tmp and seen before opening /dev/fs.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/FS/FS.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/Core/Core/IOS/FS/FS.cpp b/Source/Core/Core/IOS/FS/FS.cpp index 8fbd2248b9..730ecee28f 100644 --- a/Source/Core/Core/IOS/FS/FS.cpp +++ b/Source/Core/Core/IOS/FS/FS.cpp @@ -35,6 +35,9 @@ namespace Device { FS::FS(u32 device_id, const std::string& device_name) : Device(device_id, device_name) { + const std::string tmp_dir = BuildFilename("/tmp"); + File::DeleteDirRecursively(tmp_dir); + File::CreateDir(tmp_dir); } void FS::DoState(PointerWrap& p) @@ -134,13 +137,6 @@ void FS::DoState(PointerWrap& p) ReturnCode FS::Open(const OpenRequest& request) { - // clear tmp folder - { - std::string Path = BuildFilename("/tmp"); - File::DeleteDirRecursively(Path); - File::CreateDir(Path); - } - m_is_active = true; return IPC_SUCCESS; } |
