Module Name:    src
Committed By:   yamt
Date:           Wed Oct 12 00:03:47 UTC 2011

Modified Files:
        src/sys/uvm: uvm_mmap.c

Log Message:
fix an integer promotion bug on 64 bit ports.
(signed + unsigned = unsigned)


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/uvm/uvm_mmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_mmap.c
diff -u src/sys/uvm/uvm_mmap.c:1.137 src/sys/uvm/uvm_mmap.c:1.138
--- src/sys/uvm/uvm_mmap.c:1.137	Thu Jun 23 23:42:44 2011
+++ src/sys/uvm/uvm_mmap.c	Wed Oct 12 00:03:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_mmap.c,v 1.137 2011/06/23 23:42:44 matt Exp $	*/
+/*	$NetBSD: uvm_mmap.c,v 1.138 2011/10/12 00:03:47 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.137 2011/06/23 23:42:44 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.138 2011/10/12 00:03:47 yamt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_pax.h"
@@ -395,7 +395,7 @@ sys_mmap(struct lwp *l, const struct sys
 			fd_putfile(fd);
 			return (EINVAL);
 		}
-		if (vp->v_type != VCHR && (pos + size) < pos) {
+		if (vp->v_type != VCHR && (off_t)(pos + size) < pos) {
 			fd_putfile(fd);
 			return (EOVERFLOW);		/* no offset wrapping */
 		}

Reply via email to