mirror of
https://github.com/golang/go
synced 2024-11-20 06:04:52 -07:00
parent
db18ce2f53
commit
67dc2ae3a6
@ -462,8 +462,14 @@ main(int argc, char *argv[])
|
||||
}
|
||||
if(argc > 0)
|
||||
file = argv[0];
|
||||
else if(pid)
|
||||
else if(pid) {
|
||||
file = proctextfile(pid);
|
||||
if (file == NULL) {
|
||||
fprint(2, "prof: can't find file for pid %d: %r\n", pid);
|
||||
fprint(2, "prof: on Darwin, need to provide file name explicitly\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
fd = open(file, 0);
|
||||
if(fd < 0) {
|
||||
fprint(2, "prof: can't open %s: %r\n", file);
|
||||
|
Loading…
Reference in New Issue
Block a user