Bug 47207. Changing printf to PRINTF to use new logging facility. r=valeski,sr=waterson
This commit is contained in:
@@ -54,6 +54,10 @@
|
||||
#include "nsXPIDLString.h"
|
||||
#include "prproces.h"
|
||||
|
||||
NS_IMPL_LOG(nsLocalFileUnixLog)
|
||||
#define PRINTF FILE_PRINTF
|
||||
#define FLUSH FILE_FLUSH
|
||||
|
||||
// we need these for statfs()
|
||||
|
||||
#ifdef HAVE_SYS_STATVFS_H
|
||||
@@ -275,7 +279,7 @@ nsLocalFile::CreateAllAncestors(PRUint32 permissions)
|
||||
*slashp = buffer;
|
||||
|
||||
#ifdef DEBUG_NSIFILE
|
||||
fprintf(stderr, "nsIFile: before: %s\n", buffer);
|
||||
PRINTF("nsIFile: before: %s\n", buffer);
|
||||
#endif
|
||||
|
||||
while ((slashp = strchr(slashp + 1, '/'))) {
|
||||
@@ -297,7 +301,7 @@ nsLocalFile::CreateAllAncestors(PRUint32 permissions)
|
||||
/* Temporarily NUL-terminate here */
|
||||
*slashp = '\0';
|
||||
#ifdef DEBUG_NSIFILE
|
||||
fprintf(stderr, "nsIFile: mkdir(\"%s\")\n", buffer);
|
||||
PRINTF("nsIFile: mkdir(\"%s\")\n", buffer);
|
||||
#endif
|
||||
int result = mkdir(buffer, permissions);
|
||||
|
||||
@@ -315,7 +319,7 @@ nsLocalFile::CreateAllAncestors(PRUint32 permissions)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_NSIFILE
|
||||
fprintf(stderr, "nsIFile: after: %s\n", buffer);
|
||||
PRINTF("nsIFile: after: %s\n", buffer);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
@@ -390,7 +394,7 @@ nsLocalFile::Create(PRUint32 type, PRUint32 permissions)
|
||||
dirperm |= S_IXOTH;
|
||||
|
||||
#ifdef DEBUG_NSIFILE
|
||||
fprintf(stderr, "nsIFile: perm = %o, dirperm = %o\n", permissions,
|
||||
PRINTF("nsIFile: perm = %o, dirperm = %o\n", permissions,
|
||||
dirperm);
|
||||
#endif
|
||||
|
||||
@@ -398,7 +402,7 @@ nsLocalFile::Create(PRUint32 type, PRUint32 permissions)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
#ifdef DEBUG_NSIFILE
|
||||
fprintf(stderr, "nsIFile: Create(\"%s\") again\n", (const char *)mPath);
|
||||
PRINTF("nsIFile: Create(\"%s\") again\n", (const char *)mPath);
|
||||
#endif
|
||||
result = exclusiveCreateFunc((const char *)mPath, permissions);
|
||||
}
|
||||
@@ -626,7 +630,7 @@ nsLocalFile::CopyTo(nsIFile *newParent, const char *newName)
|
||||
return rv;
|
||||
|
||||
#ifdef DEBUG_blizzard
|
||||
printf("nsLocalFile::CopyTo() %s -> %s\n", (const char *)mPath, (const char *)newPathName);
|
||||
PRINTF("nsLocalFile::CopyTo() %s -> %s\n", (const char *)mPath, (const char *)newPathName);
|
||||
#endif
|
||||
|
||||
// actually create the file.
|
||||
@@ -702,7 +706,7 @@ nsLocalFile::CopyTo(nsIFile *newParent, const char *newName)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_blizzard
|
||||
printf("read %d bytes, wrote %d bytes\n",
|
||||
PRINTF("read %d bytes, wrote %d bytes\n",
|
||||
totalRead, totalWritten);
|
||||
#endif
|
||||
|
||||
@@ -980,13 +984,13 @@ nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
|
||||
if (STATFS(mPath, &fs_buf) < 0) {
|
||||
// The call to STATFS failed.
|
||||
#ifdef DEBUG
|
||||
printf("ERROR: GetDiskSpaceAvailable: STATFS call FAILED. \n");
|
||||
PRINTF("ERROR: GetDiskSpaceAvailable: STATFS call FAILED. \n");
|
||||
#endif
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#ifdef DEBUG_DISK_SPACE
|
||||
printf("DiskSpaceAvailable: %d bytes\n",
|
||||
fs_buf.f_bsize * (fs_buf.f_bavail - 1));
|
||||
PRINTF("DiskSpaceAvailable: %d bytes\n",
|
||||
fs_buf.f_bsize * (fs_buf.f_bavail - 1));
|
||||
#endif
|
||||
|
||||
// The number of Bytes free = The number of free blocks available to
|
||||
@@ -1008,7 +1012,7 @@ nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
|
||||
** properly for these platforms yet.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
printf("ERROR: GetDiskSpaceAvailable: Not implemented for plaforms without statfs.\n");
|
||||
PRINTF("ERROR: GetDiskSpaceAvailable: Not implemented for plaforms without statfs.\n");
|
||||
#endif
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user