summaryrefslogtreecommitdiff
path: root/sys/src/libmach
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-09-08 23:31:30 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2018-09-08 23:31:30 +0200
commite534c4147e1ab3f5891c8821c2cbac1c66bec93c (patch)
treef51faee1d9af56a948fc2fdd2db66d02e3649c6f /sys/src/libmach
parent97a2e35a0c4a408285f2e94667f6ae069bb462e8 (diff)
libmach: substitute /dev/zero for /proc/$pid/fpregs when missing (for snapfs)
Diffstat (limited to 'sys/src/libmach')
-rw-r--r--sys/src/libmach/map.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/src/libmach/map.c b/sys/src/libmach/map.c
index c668defd1..1cd142c58 100644
--- a/sys/src/libmach/map.c
+++ b/sys/src/libmach/map.c
@@ -108,11 +108,8 @@ attachproc(int pid, int kflag, int corefd, Fhdr *fp)
if (mach->fpregsize) {
sprint(buf, "/proc/%d/fpregs", pid);
fd = open(buf, mode);
- if(fd < 0) {
- close(map->seg[0].fd);
- free(map);
- return 0;
- }
+ if(fd < 0)
+ fd = open("/dev/zero", OREAD);
setmap(map, fd, mach->regsize, mach->regsize+mach->fpregsize, 0, "fpregs");
}
setmap(map, corefd, fp->txtaddr, fp->txtaddr+fp->txtsz, fp->txtaddr, "text");