summaryrefslogtreecommitdiff
path: root/indra/llvfs
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llvfs')
-rw-r--r--indra/llvfs/lldir.cpp23
-rw-r--r--indra/llvfs/lldir.h6
-rw-r--r--indra/llvfs/lldir_linux.cpp12
-rw-r--r--indra/llvfs/lldir_solaris.cpp11
-rw-r--r--indra/llvfs/lldir_win32.cpp8
-rw-r--r--indra/llvfs/lllfsthread.cpp4
-rwxr-xr-xindra/llvfs/llpidlock.cpp19
-rwxr-xr-xindra/llvfs/llpidlock.h12
-rw-r--r--indra/llvfs/llvfile.cpp2
-rw-r--r--indra/llvfs/llvfile.h1
10 files changed, 40 insertions, 58 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index 781321e5e4..da4abde451 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -200,6 +200,11 @@ const std::string &LLDir::getOSUserAppDir() const
const std::string &LLDir::getLindenUserDir() const
{
+ if (mLindenUserDir.empty())
+ {
+ lldebugs << "getLindenUserDir() called early, we don't have the user name yet - returning empty string to caller" << llendl;
+ }
+
return mLindenUserDir;
}
@@ -337,7 +342,7 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
break;
case LL_PATH_CACHE:
- prefix = getCacheDir();
+ prefix = getCacheDir();
break;
case LL_PATH_USER_SETTINGS:
@@ -348,6 +353,11 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
case LL_PATH_PER_SL_ACCOUNT:
prefix = getLindenUserDir();
+ if (prefix.empty())
+ {
+ // if we're asking for the per-SL-account directory but we haven't logged in yet (or otherwise don't know the account name from which to build this string), then intentionally return a blank string to the caller and skip the below warning about a blank prefix.
+ return std::string();
+ }
break;
case LL_PATH_CHAT_LOGS:
@@ -394,12 +404,6 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
prefix += "local_assets";
break;
- case LL_PATH_MOZILLA_PROFILE:
- prefix = getOSUserAppDir();
- prefix += mDirDelimiter;
- prefix += "browser_profile";
- break;
-
case LL_PATH_EXECUTABLE:
prefix = getExecutableDir();
break;
@@ -563,7 +567,7 @@ std::string LLDir::getForbiddenFileChars()
void LLDir::setLindenUserDir(const std::string &first, const std::string &last)
{
- // if both first and last aren't set, assume we're grabbing the cached dir
+ // if both first and last aren't set, that's bad.
if (!first.empty() && !last.empty())
{
// some platforms have case-sensitive filesystems, so be
@@ -577,10 +581,11 @@ void LLDir::setLindenUserDir(const std::string &first, const std::string &last)
mLindenUserDir += firstlower;
mLindenUserDir += "_";
mLindenUserDir += lastlower;
+ llinfos << "Got name for LLDir::setLindenUserDir(first='" << first << "', last='" << last << "')" << llendl;
}
else
{
- llerrs << "Invalid name for LLDir::setLindenUserDir" << llendl;
+ llerrs << "Invalid name for LLDir::setLindenUserDir(first='" << first << "', last='" << last << "')" << llendl;
}
dumpCurrentDirectories();
diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h
index 07c814769e..9067d75bac 100644
--- a/indra/llvfs/lldir.h
+++ b/indra/llvfs/lldir.h
@@ -38,13 +38,13 @@
#define MAX_PATH MAXPATHLEN
#endif
-// these numbers *may* get serialized, so we need to be explicit
+// these numbers *may* get serialized (really??), so we need to be explicit
typedef enum ELLPath
{
LL_PATH_NONE = 0,
LL_PATH_USER_SETTINGS = 1,
LL_PATH_APP_SETTINGS = 2,
- LL_PATH_PER_SL_ACCOUNT = 3,
+ LL_PATH_PER_SL_ACCOUNT = 3, // returns/expands to blank string if we don't know the account name yet
LL_PATH_CACHE = 4,
LL_PATH_CHARACTER = 5,
LL_PATH_HELP = 6,
@@ -54,10 +54,8 @@ typedef enum ELLPath
LL_PATH_TOP_SKIN = 10,
LL_PATH_CHAT_LOGS = 11,
LL_PATH_PER_ACCOUNT_CHAT_LOGS = 12,
- LL_PATH_MOZILLA_PROFILE = 13,
LL_PATH_USER_SKIN = 14,
LL_PATH_LOCAL_ASSETS = 15,
-// LL_PATH_HTML = 16,
LL_PATH_EXECUTABLE = 16,
LL_PATH_DEFAULT_SKIN = 17,
LL_PATH_FONTS = 18,
diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp
index 08c993ed2a..a9736560ec 100644
--- a/indra/llvfs/lldir_linux.cpp
+++ b/indra/llvfs/lldir_linux.cpp
@@ -112,9 +112,10 @@ LLDir_Linux::LLDir_Linux()
// ...normal installation running
mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins";
}
+
mOSUserDir = getCurrentUserHome(tmp_str);
mOSUserAppDir = "";
- mLindenUserDir = tmp_str;
+ mLindenUserDir = "";
char path [32]; /* Flawfinder: ignore */
@@ -225,15 +226,6 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
}
}
- res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,""));
- if (res == -1)
- {
- if (errno != EEXIST)
- {
- llwarns << "Couldn't create LL_PATH_MOZILLA_PROFILE dir " << getExpandedFilename(LL_PATH_MOZILLA_PROFILE,"") << llendl;
- }
- }
-
mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "CA.pem");
}
diff --git a/indra/llvfs/lldir_solaris.cpp b/indra/llvfs/lldir_solaris.cpp
index a21f3ca0ab..8ac5a41e93 100644
--- a/indra/llvfs/lldir_solaris.cpp
+++ b/indra/llvfs/lldir_solaris.cpp
@@ -100,7 +100,7 @@ LLDir_Solaris::LLDir_Solaris()
mAppRODataDir = strdup(tmp_str);
mOSUserDir = getCurrentUserHome(tmp_str);
mOSUserAppDir = "";
- mLindenUserDir = tmp_str;
+ mLindenUserDir = "";
char path [LL_MAX_PATH]; /* Flawfinder: ignore */
@@ -244,15 +244,6 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
}
}
- res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,""));
- if (res == -1)
- {
- if (errno != EEXIST)
- {
- llwarns << "Couldn't create LL_PATH_MOZILLA_PROFILE dir " << getExpandedFilename(LL_PATH_MOZILLA_PROFILE,"") << llendl;
- }
- }
-
mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "CA.pem");
}
diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp
index 4c376f11a5..4eb10c842b 100644
--- a/indra/llvfs/lldir_win32.cpp
+++ b/indra/llvfs/lldir_win32.cpp
@@ -212,14 +212,6 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
}
}
- res = LLFile::mkdir(getExpandedFilename(LL_PATH_MOZILLA_PROFILE,""));
- if (res == -1)
- {
- if (errno != EEXIST)
- {
- llwarns << "Couldn't create LL_PATH_MOZILLA_PROFILE dir " << getExpandedFilename(LL_PATH_MOZILLA_PROFILE,"") << llendl;
- }
- }
res = LLFile::mkdir(getExpandedFilename(LL_PATH_USER_SKIN,""));
if (res == -1)
{
diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp
index 704e1ab142..e85cc437f4 100644
--- a/indra/llvfs/lllfsthread.cpp
+++ b/indra/llvfs/lllfsthread.cpp
@@ -189,7 +189,7 @@ bool LLLFSThread::Request::processRequest()
{
llassert(mOffset >= 0);
LLAPRFile infile ;
- infile.open(mThread->getLocalAPRFilePool(), mFileName, LL_APR_RB);
+ infile.open(mFileName, LL_APR_RB, mThread->getLocalAPRFilePool());
if (!infile.getFileHandle())
{
llwarns << "LLLFS: Unable to read file: " << mFileName << llendl;
@@ -213,7 +213,7 @@ bool LLLFSThread::Request::processRequest()
if (mOffset < 0)
flags |= APR_APPEND;
LLAPRFile outfile ;
- outfile.open(mThread->getLocalAPRFilePool(), mFileName, flags);
+ outfile.open(mFileName, flags, mThread->getLocalAPRFilePool());
if (!outfile.getFileHandle())
{
llwarns << "LLLFS: Unable to write file: " << mFileName << llendl;
diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp
index 93ac120302..28cee29405 100755
--- a/indra/llvfs/llpidlock.cpp
+++ b/indra/llvfs/llpidlock.cpp
@@ -41,6 +41,15 @@
#include "llframetimer.h"
#if LL_WINDOWS //For windows platform.
+
+#include <windows.h>
+
+namespace {
+ inline DWORD getpid() {
+ return GetCurrentProcessId();
+ }
+}
+
bool isProcessAlive(U32 pid)
{
return (bool) GetProcessVersion((DWORD)pid);
@@ -59,10 +68,14 @@ class LLPidLockFile
{
public:
LLPidLockFile( ) :
- mSaving(FALSE), mWaiting(FALSE),
- mClean(TRUE), mPID(getpid())
+ mAutosave(false),
+ mSaving(false),
+ mWaiting(false),
+ mPID(getpid()),
+ mNameTable(NULL),
+ mClean(true)
{
- mLockName = gDirUtilp->getTempDir() + "/savelock";
+ mLockName = gDirUtilp->getTempDir() + gDirUtilp->getDirDelimiter() + "savelock";
}
bool requestLock(LLNameTable<void *> *name_table, bool autosave,
bool force_immediate=FALSE, F32 timeout=300.0);
diff --git a/indra/llvfs/llpidlock.h b/indra/llvfs/llpidlock.h
index 42aee4dc4f..496e99cf5a 100755
--- a/indra/llvfs/llpidlock.h
+++ b/indra/llvfs/llpidlock.h
@@ -37,17 +37,9 @@
class LLSD;
class LLFrameTimer;
-#if LL_WINDOWS //For windows platform.
-
-#include <windows.h>
-
-#define getpid GetCurrentProcessId
-
-#else //Everyone Else
-
+#if !LL_WINDOWS //For non-windows platforms.
#include <signal.h>
-
-#endif //Everyone else.
+#endif
namespace LLPidLock
{
diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp
index e0e282d7af..6751f3eb93 100644
--- a/indra/llvfs/llvfile.cpp
+++ b/indra/llvfs/llvfile.cpp
@@ -320,7 +320,7 @@ BOOL LLVFile::setMaxSize(S32 size)
if (!mVFS->checkAvailable(size))
{
- LLFastTimer t(FTM_VFILE_WAIT);
+ //LLFastTimer t(FTM_VFILE_WAIT);
S32 count = 0;
while (sVFSThread->getPending() > 1000)
{
diff --git a/indra/llvfs/llvfile.h b/indra/llvfs/llvfile.h
index 5f69a41040..c3bca8c737 100644
--- a/indra/llvfs/llvfile.h
+++ b/indra/llvfs/llvfile.h
@@ -88,7 +88,6 @@ protected:
S32 mMode;
LLVFS *mVFS;
F32 mPriority;
- BOOL mOnReadQueue;
S32 mBytesRead;
LLVFSThread::handle_t mHandle;