Merge branch 'master' of git://github.com/siana/SingularityViewer

This commit is contained in:
Lirusaito
2012-01-26 00:03:53 -05:00
4 changed files with 26 additions and 19 deletions

View File

@@ -44,19 +44,22 @@
#include <windows.h> #include <windows.h>
namespace { static U32 getPID() {
inline DWORD getpid() { return GetCurrentProcessId();
return GetCurrentProcessId();
}
} }
bool isProcessAlive(U32 pid) static bool isProcessAlive(U32 pid)
{ {
return (bool) GetProcessVersion((DWORD)pid); return (bool) GetProcessVersion((DWORD)pid);
} }
#else //Everyone Else #else //Everyone Else
bool isProcessAlive(U32 pid)
static U32 getPID() {
return getpid();
}
static bool isProcessAlive(U32 pid)
{ {
return (bool) kill( (pid_t)pid, 0); return (bool) kill( (pid_t)pid, 0);
} }
@@ -71,7 +74,7 @@ class LLPidLockFile
mAutosave(false), mAutosave(false),
mSaving(false), mSaving(false),
mWaiting(false), mWaiting(false),
mPID(getpid()), mPID(getPID()),
mNameTable(NULL), mNameTable(NULL),
mClean(true) mClean(true)
{ {

View File

@@ -1096,7 +1096,7 @@ bool RlvFolderLocks::getLockedFolders(const folderlock_source_t& lockSource, LLI
case ST_WEARABLETYPE: case ST_WEARABLETYPE:
{ {
RLV_ASSERT( ((ST_ATTACHMENTPOINT == lockSource.first) && (typeid(S32) == lockSource.second.type())) || RLV_ASSERT( ((ST_ATTACHMENTPOINT == lockSource.first) && (typeid(S32) == lockSource.second.type())) ||
((ST_WEARABLETYPE == lockSource.first) && (typeid(EWearableType) == lockSource.second.type())) ); ((ST_WEARABLETYPE == lockSource.first) && (typeid(LLWearableType::EType) == lockSource.second.type())) );
uuid_vec_t idItems; uuid_vec_t idItems;
if (ST_ATTACHMENTPOINT == lockSource.first) if (ST_ATTACHMENTPOINT == lockSource.first)
@@ -1286,6 +1286,9 @@ void RlvFolderLocks::refreshLockedLookups() const
case LLAssetType::AT_OBJECT: case LLAssetType::AT_OBJECT:
m_LockedAttachmentRem.push_back(pItem->getLinkedUUID()); m_LockedAttachmentRem.push_back(pItem->getLinkedUUID());
break; break;
default:
RLV_ASSERT(true);
break;
} }
} }
} }

View File

@@ -630,12 +630,13 @@ inline bool RlvFolderLocks::canRemoveFolder(const LLUUID& idFolder) const
// Checked: 2011-03-29 (RLVa-1.3.0g) | Added: RLVa-1.3.0g // Checked: 2011-03-29 (RLVa-1.3.0g) | Added: RLVa-1.3.0g
inline bool RlvFolderLocks::canRenameFolder(const LLUUID& idFolder) const inline bool RlvFolderLocks::canRenameFolder(const LLUUID& idFolder) const
{ {
// Block renaming a folder if: /* Block renaming a folder if:
// - the folder (or one of its descendents) is explicitly locked by: // - the folder (or one of its descendents) is explicitly locked by:
// -> a "shared path" => renaming the folder would change the shared path and hence invalidate the lock // -> a "shared path" => renaming the folder would change the shared path and hence invalidate the lock
// -> an attachment point \ // -> an attachment point \
// -> an attachment |--> renaming the folder to a "dot" (=invisible) folder would invalidate the lock // -> an attachment |--> renaming the folder to a "dot" (=invisible) folder would invalidate the lock
// -> a wearable type / // -> a wearable type /
*/
return !hasLockedFolderDescendent(idFolder, ST_SHAREDPATH | ST_ATTACHMENT | ST_ATTACHMENTPOINT | ST_WEARABLETYPE, PERM_MASK_ANY, RLV_LOCK_ANY, true); return !hasLockedFolderDescendent(idFolder, ST_SHAREDPATH | ST_ATTACHMENT | ST_ATTACHMENTPOINT | ST_WEARABLETYPE, PERM_MASK_ANY, RLV_LOCK_ANY, true);
} }