diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1999-08-04 18:24:11 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1999-08-04 18:24:11 +0000 |
commit | 2e50cf9265b9d7a92e4b7cf734048d123034168e (patch) | |
tree | 3fa1f2642e194c6bd15aeba41d831dd40b3272c1 | |
parent | ed5365f1bc90c57b7b7d4e35e642918be83026a8 (diff) |
supply particular mapping type to the mmap(2) instead of bogus 0
-rw-r--r-- | usr.bin/tail/forward.c | 8 | ||||
-rw-r--r-- | usr.bin/tail/reverse.c | 8 | ||||
-rw-r--r-- | usr.bin/xinstall/xinstall.c | 12 |
3 files changed, 14 insertions, 14 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index f77edd00a6f..d23f6dfe4d0 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: forward.c,v 1.7 1999/02/03 02:09:30 millert Exp $ */ +/* $OpenBSD: forward.c,v 1.8 1999/08/04 18:24:10 mickey Exp $ */ /* $NetBSD: forward.c,v 1.7 1996/02/13 16:49:10 ghudson Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)forward.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: forward.c,v 1.7 1999/02/03 02:09:30 millert Exp $"; +static char rcsid[] = "$OpenBSD: forward.c,v 1.8 1999/08/04 18:24:10 mickey Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -217,8 +217,8 @@ rlines(fp, off, sbp) if (size > SIZE_T_MAX) return (1); - if ((start = mmap(NULL, (size_t)size, PROT_READ, 0, fileno(fp), - (off_t)0)) == (caddr_t)-1) + if ((start = mmap(NULL, (size_t)size, PROT_READ, MAP_PRIVATE, + fileno(fp), (off_t)0)) == (caddr_t)-1) return (1); /* Last char is special, ignore whether newline or not. */ diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c index 06c181bf3fa..927dfb1db95 100644 --- a/usr.bin/tail/reverse.c +++ b/usr.bin/tail/reverse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reverse.c,v 1.5 1999/04/29 04:18:43 mickey Exp $ */ +/* $OpenBSD: reverse.c,v 1.6 1999/08/04 18:24:10 mickey Exp $ */ /* $NetBSD: reverse.c,v 1.6 1994/11/23 07:42:10 jtc Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)reverse.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: reverse.c,v 1.5 1999/04/29 04:18:43 mickey Exp $"; +static char rcsid[] = "$OpenBSD: reverse.c,v 1.6 1999/08/04 18:24:10 mickey Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -126,8 +126,8 @@ r_reg(fp, style, off, sbp) if (size > SIZE_T_MAX) return (1); - if ((start = mmap(NULL, (size_t)size, PROT_READ, 0, fileno(fp), - (off_t)0)) == (caddr_t)-1) + if ((start = mmap(NULL, (size_t)size, PROT_READ, MAP_PRIVATE, + fileno(fp), (off_t)0)) == (caddr_t)-1) return (1); p = start + size - 1; diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 6459dbcd08b..e8ce80d921f 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xinstall.c,v 1.21 1999/05/29 20:17:35 millert Exp $ */ +/* $OpenBSD: xinstall.c,v 1.22 1999/08/04 18:24:09 mickey Exp $ */ /* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93"; #endif -static char rcsid[] = "$OpenBSD: xinstall.c,v 1.21 1999/05/29 20:17:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: xinstall.c,v 1.22 1999/08/04 18:24:09 mickey Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -522,11 +522,11 @@ compare(from_fd, from_name, from_len, to_fd, to_name, to_len) length = MIN(remainder, 8 * 1048576); remainder -= length; - if ((p1 = mmap(NULL, length, PROT_READ, 0, from_fd, from_off)) - == MAP_FAILED) + if ((p1 = mmap(NULL, length, PROT_READ, MAP_PRIVATE, + from_fd, from_off)) == MAP_FAILED) err(EX_OSERR, "%s", from_name); - if ((p2 = mmap(NULL, length, PROT_READ, 0, to_fd, to_off)) - == MAP_FAILED) + if ((p2 = mmap(NULL, length, PROT_READ, MAP_PRIVATE, + to_fd, to_off)) == MAP_FAILED) err(EX_OSERR, "%s", to_name); dfound = memcmp(p1, p2, length); |