Bug 1305037 - simplify the getpid usage r?alchen
MozReview-Commit-ID: 1ra57AW9xug
--- a/xpcom/base/nsStatusReporterManager.cpp
+++ b/xpcom/base/nsStatusReporterManager.cpp
@@ -82,24 +82,22 @@ NS_STATUS_REPORTER_IMPLEMENT(StatusRepor
if (NS_WARN_IF(NS_FAILED(rvDump))) \
return rvDump; \
} while (0)
static nsresult
DumpReport(nsIFileOutputStream* aOStream, const nsCString& aProcess,
const nsCString& aName, const nsCString& aDescription)
{
- int pid;
if (aProcess.IsEmpty()) {
- pid = getpid();
+ int pid = getpid();
nsPrintfCString pidStr("PID %u", pid);
DUMP(aOStream, "\n {\n \"Process\": \"");
DUMP(aOStream, pidStr.get());
} else {
- pid = 0;
DUMP(aOStream, "\n { \"Unknown Process\": \"");
}
DUMP(aOStream, "\",\n \"Reporter name\": \"");
DUMP(aOStream, aName.get());
DUMP(aOStream, "\",\n \"Status Description\": [\"");
nsCString desc = aDescription;