mirror of
https://github.com/wiiu-env/ContentRedirectionModule.git
synced 2024-11-13 07:05:14 +01:00
Improve setting the CWD for client, at basic error handling
This commit is contained in:
parent
897bc37ae4
commit
921725efdb
@ -36,9 +36,18 @@ std::string getFullPathForFSClient(FSClient *pClient, const char *path) {
|
||||
}
|
||||
|
||||
void setWorkingDirForFSClient(FSClient *client, const char *path) {
|
||||
if (!path) {
|
||||
DEBUG_FUNCTION_LINE_WARN("Path was NULL");
|
||||
return;
|
||||
}
|
||||
std::lock_guard<std::mutex> workingDirLock(workingDirMutexFS);
|
||||
|
||||
workingDirsFS[client] = path;
|
||||
std::string cwd(path);
|
||||
if (cwd.empty() || cwd.back() != '/') {
|
||||
cwd.push_back('/');
|
||||
}
|
||||
|
||||
workingDirsFS[client] = cwd;
|
||||
OSMemoryBarrier();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user