mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-09 06:22:08 +00:00
Fixes bug 71397. s/r=waterson@netscape.com
This commit is contained in:
parent
61b5f3beff
commit
f667808665
@ -104,6 +104,10 @@ nsFileIO::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
||||
NS_IMETHODIMP
|
||||
nsFileIO::Init(nsIFile* file, PRInt32 ioFlags, PRInt32 perm)
|
||||
{
|
||||
NS_ASSERTION(file, "File must not be null");
|
||||
if (file == nsnull)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
mFile = file;
|
||||
mIOFlags = ioFlags;
|
||||
mPerm = perm;
|
||||
@ -125,6 +129,10 @@ nsFileIO::GetFile(nsIFile* *aFile)
|
||||
NS_IMETHODIMP
|
||||
nsFileIO::Open(char **contentType, PRInt32 *contentLength)
|
||||
{
|
||||
NS_ASSERTION(mFile, "File must not be null");
|
||||
if (mFile == nsnull)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
// don't actually open the file here -- we'll do it on demand in the
|
||||
// GetInputStream/GetOutputStream methods
|
||||
nsresult rv = NS_OK;
|
||||
@ -188,6 +196,10 @@ nsFileIO::Close(nsresult status)
|
||||
NS_IMETHODIMP
|
||||
nsFileIO::GetInputStream(nsIInputStream * *aInputStream)
|
||||
{
|
||||
NS_ASSERTION(mFile, "File must not be null");
|
||||
if (mFile == nsnull)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
nsresult rv;
|
||||
PRBool isDir;
|
||||
rv = mFile->IsDirectory(&isDir);
|
||||
@ -224,6 +236,10 @@ nsFileIO::GetInputStream(nsIInputStream * *aInputStream)
|
||||
NS_IMETHODIMP
|
||||
nsFileIO::GetOutputStream(nsIOutputStream * *aOutputStream)
|
||||
{
|
||||
NS_ASSERTION(mFile, "File must not be null");
|
||||
if (mFile == nsnull)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
nsresult rv;
|
||||
PRBool isDir;
|
||||
rv = mFile->IsDirectory(&isDir);
|
||||
@ -257,6 +273,10 @@ nsFileIO::GetOutputStream(nsIOutputStream * *aOutputStream)
|
||||
NS_IMETHODIMP
|
||||
nsFileIO::GetName(char* *aName)
|
||||
{
|
||||
NS_ASSERTION(mFile, "File must not be null");
|
||||
if (mFile == nsnull)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
return mFile->GetPath(aName);
|
||||
}
|
||||
|
||||
|
@ -1920,6 +1920,8 @@ nsSocketBOS::Write(const char *aBuf, PRUint32 aCount, PRUint32 *aBytesWritten)
|
||||
|
||||
tryWrite:
|
||||
total = PR_Write(mSock, aBuf, aCount);
|
||||
LOG(("nsSocketBOS PR_Write [this=%x] wrote %d\n", this, total));
|
||||
|
||||
if (total < 0) {
|
||||
if (PR_GetError() == PR_WOULD_BLOCK_ERROR) {
|
||||
//
|
||||
@ -1933,6 +1935,7 @@ tryWrite:
|
||||
LOG(("nsSocketBOS::Write [this=%x] Poll succeeded; looping back to PR_Write\n", this));
|
||||
goto tryWrite;
|
||||
}
|
||||
LOG(("nsSocketBOS::Write [this=%x] Write Failed [rv=%x]\n", this, PR_GetError()));
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user