]> Cypherpunks repositories - gostls13.git/commitdiff
misc/pprof: support web profiles on windows/MinGW
authorChaiShushan <chaishushan@gmail.com>
Wed, 23 Jul 2014 17:35:04 +0000 (10:35 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 23 Jul 2014 17:35:04 +0000 (10:35 -0700)
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/117060043

misc/pprof

index ad3f1ebe1626386413e2de48d0a3e18fc397a716..f83e6fb659b4d40cdc0904b6a28afd84388a1f77 100755 (executable)
@@ -724,18 +724,24 @@ sub RunWeb {
   my $fname = shift;
   print STDERR "Loading web page file:///$fname\n";
 
-  if (`uname` =~ /Darwin/) {
+  my $uname = `uname`;
+  if ($uname =~ /Darwin/) {
     # OS X: open will use standard preference for SVG files.
     system("/usr/bin/open", $fname);
     return;
   }
 
-  if (`uname` =~ /CYGWIN/) {
+  if ($uname =~ /CYGWIN/) {
     # Windows(cygwin): open will use standard preference for SVG files.
     my $winname = `cygpath -wa $fname`;
     system("explorer.exe", $winname);
     return;
   }
+  if ($uname =~ /MINGW/) {
+    # Windows(MinGW): open will use standard preference for SVG files.
+    system("cmd", "/c", "start", $fname);
+    return;
+  }
 
   # Some kind of Unix; try generic symlinks, then specific browsers.
   # (Stop once we find one.)