movind implementation of FilleStatCache into nsLocalFileUnix.cpp
where other calls to lstat work fine This is an attempt to fix bustage on some linux platfroms --pete git-svn-id: svn://10.0.0.236/trunk@112996 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
0945a8d405
commit
e39572043e
@ -65,34 +65,6 @@
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
/**
|
||||
* we need these for statfs()
|
||||
*/
|
||||
#ifdef HAVE_SYS_STATVFS_H
|
||||
#if defined(__osf__) && defined(__DECCXX)
|
||||
extern "C" int statvfs(const char *, struct statvfs *);
|
||||
#endif
|
||||
#include <sys/statvfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STATFS_H
|
||||
#include <sys/statfs.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STATVFS
|
||||
#define STATFS statvfs
|
||||
#else
|
||||
#define STATFS statfs
|
||||
#endif
|
||||
|
||||
// so we can statfs on freebsd
|
||||
#if defined(__FreeBSD__)
|
||||
#define HAVE_SYS_STATFS_H
|
||||
#define STATFS statfs
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
// On some platforms file/directory name comparisons need to
|
||||
// be case-blind.
|
||||
#if defined(VMS)
|
||||
@ -251,6 +223,18 @@ nsLocalFile::nsLocalFileConstructor(nsISupports *outer,
|
||||
return inst->QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsLocalFile::FillStatCache() {
|
||||
if (stat(mPath.get(), &mCachedStat) == -1) {
|
||||
// try lstat it may be a symlink
|
||||
if (lstat(mPath.get(), &mCachedStat) == -1) {
|
||||
return NSRESULT_FOR_ERRNO();
|
||||
}
|
||||
}
|
||||
mHaveCachedStat = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::Clone(nsIFile **file)
|
||||
{
|
||||
|
||||
@ -125,17 +125,8 @@ protected:
|
||||
char **_retval);
|
||||
|
||||
void InvalidateCache() { mHaveCachedStat = PR_FALSE; }
|
||||
nsresult FillStatCache();
|
||||
|
||||
nsresult FillStatCache() {
|
||||
if (stat(mPath.get(), &mCachedStat) == -1) {
|
||||
// try lstat it may be a symlink
|
||||
if (lstat(mPath.get(), &mCachedStat) == -1) {
|
||||
return NSRESULT_FOR_ERRNO();
|
||||
}
|
||||
}
|
||||
mHaveCachedStat = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* _nsLocalFileUNIX_H_ */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user