diff --git a/sys/src/libmach/map.c b/sys/src/libmach/map.c old mode 100644 new mode 100755 index c745d82a6..c668defd1 --- a/sys/src/libmach/map.c +++ b/sys/src/libmach/map.c @@ -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);