Fixed to truncate by default. Fixed permissions to default to 664.

This commit is contained in:
warren%netscape.com 2000-04-14 09:32:24 +00:00
Родитель e12baad72a
Коммит e495d8bf34
3 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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);