mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
parent
b586913598
commit
2531de02eb
85 changed files with 68 additions and 1357 deletions
|
|
@ -49,27 +49,6 @@ WriteToFile(nsIFile *lf, const char *data, uint32_t len, int32_t flags)
|
|||
PRFileDesc *fd;
|
||||
int32_t mode = 0600;
|
||||
nsresult rv;
|
||||
#if defined(MOZ_WIDGET_GONK)
|
||||
// The sdcard on a B2G phone looks like:
|
||||
// d---rwx--- system sdcard_rw 1970-01-01 01:00:00 sdcard
|
||||
// On the emulator, xpcshell fails when using 0600 mode to open the file,
|
||||
// and 0660 works.
|
||||
nsCOMPtr<nsIFile> parent;
|
||||
rv = lf->GetParent(getter_AddRefs(parent));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
uint32_t parentPerm;
|
||||
rv = parent->GetPermissions(&parentPerm);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
if ((parentPerm & 0700) == 0) {
|
||||
// Parent directory has no owner-write, so try to use group permissions
|
||||
// instead of owner permissions.
|
||||
mode = 0660;
|
||||
}
|
||||
#endif
|
||||
rv = lf->OpenNSPRFileDesc(flags, mode, &fd);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue