summaryrefslogtreecommitdiff
path: root/indra/llvfs/lldir_linux.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-07-20 20:38:05 +0000
committerDon Kjer <don@lindenlab.com>2007-07-20 20:38:05 +0000
commitd373dcc7cbed5fdea72c6b71a5594e4e85549b43 (patch)
tree140e20f48db5dc4d7842f05ef2c24ef9e6fc3238 /indra/llvfs/lldir_linux.cpp
parentc78f99b0b3b4b9ac99a69b63315e821d89a89a3b (diff)
svn merge -r 64548:64837 svn+ssh://svn/svn/linden/branches/maintenance into release
* WARNING *: maintenance r64837 is not the last rev to use in the next merge. use r65269
Diffstat (limited to 'indra/llvfs/lldir_linux.cpp')
-rw-r--r--indra/llvfs/lldir_linux.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp
index bc8c173492..42e84edf44 100644
--- a/indra/llvfs/lldir_linux.cpp
+++ b/indra/llvfs/lldir_linux.cpp
@@ -55,7 +55,16 @@ LLDir_Linux::LLDir_Linux()
mDirp = NULL;
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
- getcwd(tmp_str, LL_MAX_PATH);
+ if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
+ {
+ strcpy(tmp_str, "/tmp");
+ llwarns << "Could not get current directory; changing to "
+ << tmp_str << llendl;
+ if (chdir(tmp_str) == -1)
+ {
+ llerrs << "Could not change directory to " << tmp_str << llendl;
+ }
+ }
mExecutableFilename = "";
mExecutablePathAndName = "";
@@ -308,7 +317,11 @@ void LLDir_Linux::getRandomFileInDir(const std::string &dirname, const std::stri
std::string LLDir_Linux::getCurPath()
{
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
- getcwd(tmp_str, LL_MAX_PATH);
+ if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
+ {
+ llwarns << "Could not get current directory" << llendl;
+ tmp_str[0] = '\0';
+ }
return tmp_str;
}