summaryrefslogtreecommitdiff
path: root/utils/libmach/map.c
diff options
context:
space:
mode:
authorforsyth <forsyth@lavoro.terzarima.net>2013-06-03 21:01:14 +0000
committerforsyth <forsyth@lavoro.terzarima.net>2013-06-03 21:01:14 +0000
commit45a20ab721a513710138340faff3d59a31c3e01e (patch)
treeeea29d2684c51cc73725b8992a2125bede48e118 /utils/libmach/map.c
parentcd8e99851af33e52bcdf8faf34f9d4e62fa0cbaf (diff)
sync compilers with Plan 9
remove 1[acl] 2[acl]
Diffstat (limited to 'utils/libmach/map.c')
-rw-r--r--utils/libmach/map.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/utils/libmach/map.c b/utils/libmach/map.c
index e1d6010e..12bee1be 100644
--- a/utils/libmach/map.c
+++ b/utils/libmach/map.c
@@ -83,21 +83,19 @@ attachproc(int pid, int kflag, int corefd, Fhdr *fp)
int fd;
Map *map;
uvlong n;
- int mode;
map = newmap(0, 4);
if (!map)
return 0;
- if(kflag) {
+ if(kflag)
regs = "kregs";
- mode = OREAD;
- } else {
+ else
regs = "regs";
- mode = ORDWR;
- }
if (mach->regsize) {
sprint(buf, "/proc/%d/%s", pid, regs);
- fd = open(buf, mode);
+ fd = open(buf, ORDWR);
+ if(fd < 0)
+ fd = open(buf, OREAD);
if(fd < 0) {
free(map);
return 0;
@@ -106,7 +104,9 @@ attachproc(int pid, int kflag, int corefd, Fhdr *fp)
}
if (mach->fpregsize) {
sprint(buf, "/proc/%d/fpregs", pid);
- fd = open(buf, mode);
+ fd = open(buf, ORDWR);
+ if(fd < 0)
+ fd = open(buf, OREAD);
if(fd < 0) {
close(map->seg[0].fd);
free(map);