Bug 1305037 - simplify the getpid usage r?alchen draft
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 23 Sep 2016 15:02:23 +0200
changeset 417006 5135aeb9ada0e440f4d84e2526690c5b00cc7bd6
parent 417005 980dcc2cfe74a998edfe7e26f125fe17646709fa
child 417007 3ce676a5cafc3c932760e85e09f5c2bc7b8431c6
push id30308
push userbmo:sledru@mozilla.com
push dateFri, 23 Sep 2016 13:19:36 +0000
reviewersalchen
bugs1305037
milestone51.0a1
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;