Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/sys/uvm/mmap Fix off-by one when computing page coun...



details:   https://anonhg.NetBSD.org/src/rev/5eb508f06303
branches:  trunk
changeset: 532292:5eb508f06303
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Tue Jun 04 22:17:47 2002 +0000

description:
Fix off-by one when computing page count in the test file.

diffstat:

 regress/sys/uvm/mmap/mmap.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r cafabb032623 -r 5eb508f06303 regress/sys/uvm/mmap/mmap.c
--- a/regress/sys/uvm/mmap/mmap.c       Tue Jun 04 22:11:15 2002 +0000
+++ b/regress/sys/uvm/mmap/mmap.c       Tue Jun 04 22:17:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mmap.c,v 1.13 2002/04/07 11:25:40 wiz Exp $    */
+/*     $NetBSD: mmap.c,v 1.14 2002/06/04 22:17:47 fvdl Exp $   */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -119,7 +119,9 @@
 
        (void) close(fd);
 
-       npgs = (st.st_size / pgsize) + 1;
+       npgs = (st.st_size / pgsize);
+       if (st.st_size % pgsize != 0)
+               npgs++;
 
        printf("    CHECKING RESIDENCY\n");
 



Home | Main Index | Thread Index | Old Index