bug 637487 - Unable to install extensions when Fennec moved to SD Card r=dougt a=blocking-fennec

This commit is contained in:
Brad Lassey 2011-03-04 17:57:25 -05:00
parent 307b2ffa11
commit 40bf82c592

View File

@ -119,6 +119,7 @@ static nsresult MacErrorMapper(OSErr inErr);
#ifdef ANDROID
#include "AndroidBridge.h"
#include "nsIMIMEService.h"
#include <linux/magic.h>
#endif
#include "nsNativeCharsetUtils.h"
@ -1103,9 +1104,20 @@ nsLocalFile::SetPermissions(PRUint32 aPermissions)
* Race condition here: we should use fchmod instead, there's no way to
* guarantee the name still refers to the same file.
*/
if (chmod(mPath.get(), aPermissions) < 0)
return NSRESULT_FOR_ERRNO();
return NS_OK;
if (chmod(mPath.get(), aPermissions) >= 0)
return NS_OK;
#if defined(ANDROID) && defined(STATFS)
// For the time being, this is restricted for use by Android, but we
// will figure out what to do for all platforms in bug 638503
struct STATFS sfs;
if (STATFS(mPath.get(), &sfs) < 0)
return NSRESULT_FOR_ERRNO();
// if this is a FAT file system we can't set file permissions
if (sfs.f_type == MSDOS_SUPER_MAGIC )
return NS_OK;
#endif
return NSRESULT_FOR_ERRNO();
}
NS_IMETHODIMP