libmach: fix acid -k regression (was broken in r5eeb36d3ddd0)

This commit is contained in:
cinap_lenrek 2012-08-07 03:48:56 +02:00
parent 6baaf0a773
commit e15b523a6c

8
sys/src/libmach/map.c Normal file → Executable file
View file

@ -89,11 +89,13 @@ attachproc(int pid, int kflag, int corefd, Fhdr *fp)
map = newmap(0, 4);
if (!map)
return 0;
if(kflag)
if(kflag) {
regs = "kregs";
else
mode = OREAD;
} else {
regs = "regs";
mode = ORDWR;
mode = ORDWR;
}
if (mach->regsize) {
sprint(buf, "/proc/%d/%s", pid, regs);
fd = open(buf, mode);