libmach: fix acid -k regression (was broken in r5eeb36d3ddd0)
This commit is contained in:
parent
6baaf0a773
commit
e15b523a6c
8
sys/src/libmach/map.c
Normal file → Executable file
8
sys/src/libmach/map.c
Normal file → Executable file
|
@ -89,11 +89,13 @@ attachproc(int pid, int kflag, int corefd, Fhdr *fp)
|
||||||
map = newmap(0, 4);
|
map = newmap(0, 4);
|
||||||
if (!map)
|
if (!map)
|
||||||
return 0;
|
return 0;
|
||||||
if(kflag)
|
if(kflag) {
|
||||||
regs = "kregs";
|
regs = "kregs";
|
||||||
else
|
mode = OREAD;
|
||||||
|
} else {
|
||||||
regs = "regs";
|
regs = "regs";
|
||||||
mode = ORDWR;
|
mode = ORDWR;
|
||||||
|
}
|
||||||
if (mach->regsize) {
|
if (mach->regsize) {
|
||||||
sprint(buf, "/proc/%d/%s", pid, regs);
|
sprint(buf, "/proc/%d/%s", pid, regs);
|
||||||
fd = open(buf, mode);
|
fd = open(buf, mode);
|
||||||
|
|
Loading…
Reference in a new issue