From: ChaiShushan Date: Wed, 23 Jul 2014 17:35:04 +0000 (-0700) Subject: misc/pprof: support web profiles on windows/MinGW X-Git-Tag: go1.4beta1~1022 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8cb040771bc9ef65834669b7924b87ef76d9b092;p=gostls13.git misc/pprof: support web profiles on windows/MinGW LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/117060043 --- diff --git a/misc/pprof b/misc/pprof index ad3f1ebe16..f83e6fb659 100755 --- a/misc/pprof +++ b/misc/pprof @@ -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.)