aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llvfs/lldir_linux.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:04 -0500
committerJacek Antonelli2008-08-15 23:45:04 -0500
commit117e22047c5752352342d64e3fb7ce00a4eb8113 (patch)
treee32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/llvfs/lldir_linux.cpp
parentSecond Life viewer sources 1.18.0.6 (diff)
downloadmeta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/llvfs/lldir_linux.cpp')
-rw-r--r--linden/indra/llvfs/lldir_linux.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/linden/indra/llvfs/lldir_linux.cpp b/linden/indra/llvfs/lldir_linux.cpp
index e3aada6..7cf1c2a 100644
--- a/linden/indra/llvfs/lldir_linux.cpp
+++ b/linden/indra/llvfs/lldir_linux.cpp
@@ -75,7 +75,16 @@ LLDir_Linux::LLDir_Linux()
75 mDirp = NULL; 75 mDirp = NULL;
76 76
77 char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */ 77 char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
78 getcwd(tmp_str, LL_MAX_PATH); 78 if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
79 {
80 strcpy(tmp_str, "/tmp");
81 llwarns << "Could not get current directory; changing to "
82 << tmp_str << llendl;
83 if (chdir(tmp_str) == -1)
84 {
85 llerrs << "Could not change directory to " << tmp_str << llendl;
86 }
87 }
79 88
80 mExecutableFilename = ""; 89 mExecutableFilename = "";
81 mExecutablePathAndName = ""; 90 mExecutablePathAndName = "";
@@ -328,7 +337,11 @@ void LLDir_Linux::getRandomFileInDir(const std::string &dirname, const std::stri
328std::string LLDir_Linux::getCurPath() 337std::string LLDir_Linux::getCurPath()
329{ 338{
330 char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */ 339 char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
331 getcwd(tmp_str, LL_MAX_PATH); 340 if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
341 {
342 llwarns << "Could not get current directory" << llendl;
343 tmp_str[0] = '\0';
344 }
332 return tmp_str; 345 return tmp_str;
333} 346}
334 347