Bug 1305037 - simplify the getpid usage r=alchen
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 23 Sep 2016 15:02:23 +0200
changeset 358097 0e40a09d2e9b23075e628f70d1d0575aa2507d2b
parent 358096 ab6fe8c99406917c9f70118fb275e8ad0e1398e4
child 358098 eb1051d722ce88529f6d1c1ffd050949688ee8a6
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalchen
bugs1305037
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1305037 - simplify the getpid usage r=alchen MozReview-Commit-ID: 1ra57AW9xug
xpcom/base/nsStatusReporterManager.cpp
--- 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;