Commit 6aec6af9 authored by Brad King's avatar Brad King
Browse files

SystemTools: Return Status from ChangeDirectory

parent 2446b205
......@@ -3071,9 +3071,12 @@ bool SystemTools::ReadSymlink(const std::string& newName,
}
#endif
int SystemTools::ChangeDirectory(const std::string& dir)
Status SystemTools::ChangeDirectory(std::string const& dir)
{
return Chdir(dir);
if (Chdir(dir) < 0) {
return Status::POSIX_errno();
}
return Status::Success();
}
std::string SystemTools::GetCurrentWorkingDirectory()
......
......@@ -879,7 +879,7 @@ public:
/**
* Change directory to the directory specified
*/
static int ChangeDirectory(const std::string& dir);
static Status ChangeDirectory(std::string const& dir);
/**
* Get the result of strerror(errno)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment