mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
bug 637487 - Unable to install extensions when Fennec moved to SD Card r=dougt a=blocking-fennec
This commit is contained in:
parent
3ccdc55c73
commit
81cc8b631f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user