From 72edd4b9183beb549ef788d998fcff589fac2f79 Mon Sep 17 00:00:00 2001 From: mycroft Date: Thu, 19 May 1994 18:03:04 +0000 Subject: [PATCH] For MAP_ANON, force the file offset to 0. I can't think of any any bad side effects of this, and it fixes an interesting bug. --- sys/vm/vm_mmap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index c1ed5ddc798a..bd5f605d67d1 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -37,7 +37,7 @@ * * from: Utah Hdr: vm_mmap.c 1.3 90/01/21 * from: @(#)vm_mmap.c 7.5 (Berkeley) 6/28/91 - * $Id: vm_mmap.c,v 1.26 1994/05/07 00:39:58 cgd Exp $ + * $Id: vm_mmap.c,v 1.27 1994/05/19 18:03:04 mycroft Exp $ */ /* @@ -577,9 +577,10 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff) * gain a reference to ensure continued existance of the object. * (XXX the exception is to appease the pageout daemon) */ - if (flags & MAP_ANON) + if (flags & MAP_ANON) { type = PG_DFLT; - else { + foff = 0; + } else { vp = (struct vnode *)handle; if (vp->v_type == VCHR) { type = PG_DEVICE;