summaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-05-03 18:16:11 +0000
committerRoland McGrath <roland@gnu.org>1996-05-03 18:16:11 +0000
commitca12258310f1f82ac473d9ff94a517588334fd95 (patch)
tree88b6be73bc82e5cef0d115e430b49f68a7c55aa1 /exec
parentae6ce81e87ad7326c618b2130368cec1fc295cc8 (diff)
(map): Use F->__offset and F->__target properly.
Diffstat (limited to 'exec')
-rw-r--r--exec/exec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/exec/exec.c b/exec/exec.c
index 1734c5c3..b9e9621d 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -427,8 +427,8 @@ map (struct execdata *e, off_t posn, size_t len)
const size_t size = e->file_size;
size_t offset;
- if ((f->__target & ~(f->__bufsize - 1)) == (posn & ~(f->__bufsize - 1)) &&
- f->__buffer + (posn + len - f->__target) < f->__get_limit)
+ if ((f->__offset & ~(f->__bufsize - 1)) == (posn & ~(f->__bufsize - 1)) &&
+ f->__buffer + (posn + len - f->__offset) < f->__get_limit)
/* The current mapping window covers it. */
offset = posn & (f->__bufsize - 1);
else if (e->filemap == MACH_PORT_NULL)
@@ -454,7 +454,7 @@ map (struct execdata *e, off_t posn, size_t len)
f->__bufsize = round_page (nread);
}
- f->__target = posn;
+ f->__offset = posn;
f->__get_limit = f->__buffer + nread;
offset = 0;
}
@@ -468,8 +468,8 @@ map (struct execdata *e, off_t posn, size_t len)
/* Make sure our mapping is page-aligned in the file. */
offset = posn & (vm_page_size - 1);
- f->__target = trunc_page (posn);
- f->__bufsize = round_page (posn + len) - f->__target;
+ f->__offset = trunc_page (posn);
+ f->__bufsize = round_page (posn + len) - f->__offset;
/* Map the data from the file. */
if (vm_map (mach_task_self (),
@@ -485,13 +485,13 @@ map (struct execdata *e, off_t posn, size_t len)
if (e->cntl)
e->cntl->accessed = 1;
- if (f->__target + f->__bufsize > size)
+ if (f->__offset + f->__bufsize > size)
f->__get_limit = f->__buffer + (size - f->__target);
else
f->__get_limit = f->__buffer + f->__bufsize;
}
- f->__offset = f->__target;
+ f->__target = f->__offset;
f->__bufp = f->__buffer + offset;
if (f->__bufp + len > f->__get_limit)