зеркало из https://github.com/mozilla/gecko-dev.git
Fixed to truncate by default. Fixed permissions to default to 664.
This commit is contained in:
Родитель
e12baad72a
Коммит
e495d8bf34
|
@ -474,7 +474,7 @@ nsJARChannel::EnsureJARFileAvailable(OnJARFileAvailableFun onJARFileAvailable,
|
|||
|
||||
// use a file transport to serve as a data pump for the download (done
|
||||
// on some other thread)
|
||||
rv = fts->CreateTransport(jarCacheFile, PR_WRONLY | PR_CREATE_FILE, 0,
|
||||
rv = fts->CreateTransport(jarCacheFile, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0664,
|
||||
getter_AddRefs(mJarCacheTransport));
|
||||
if (NS_FAILED(rv)) goto error;
|
||||
rv = mJarCacheTransport->SetBufferSegmentSize(mBufferSegmentSize);
|
||||
|
|
|
@ -418,8 +418,8 @@ nsFileOutputStream::Init(nsIFile* file, PRInt32 ioFlags, PRInt32 perm)
|
|||
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(file, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (ioFlags == -1)
|
||||
ioFlags = PR_WRONLY | PR_CREATE_FILE;
|
||||
if (perm == -1)
|
||||
ioFlags = PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE;
|
||||
if (perm <= 0)
|
||||
perm = 0664;
|
||||
return localFile->OpenNSPRFileDesc(ioFlags, perm, &mFD);
|
||||
}
|
||||
|
|
|
@ -474,7 +474,7 @@ nsJARChannel::EnsureJARFileAvailable(OnJARFileAvailableFun onJARFileAvailable,
|
|||
|
||||
// use a file transport to serve as a data pump for the download (done
|
||||
// on some other thread)
|
||||
rv = fts->CreateTransport(jarCacheFile, PR_WRONLY | PR_CREATE_FILE, 0,
|
||||
rv = fts->CreateTransport(jarCacheFile, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0664,
|
||||
getter_AddRefs(mJarCacheTransport));
|
||||
if (NS_FAILED(rv)) goto error;
|
||||
rv = mJarCacheTransport->SetBufferSegmentSize(mBufferSegmentSize);
|
||||
|
|
Загрузка…
Ссылка в новой задаче