aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/xinstall
diff options
context:
space:
mode:
authorAlexander Langer <alex@FreeBSD.org>1997-01-16 21:58:40 +0000
committerAlexander Langer <alex@FreeBSD.org>1997-01-16 21:58:40 +0000
commit8abdc2eb40c03b97153f2a01bdb53927f3a336c1 (patch)
treed61898dd79824c10ca33127214d8569c804559c2 /usr.bin/xinstall
parent839cc09e5384e6f8c0ebb9203052015b532cfce7 (diff)
Notes
Diffstat (limited to 'usr.bin/xinstall')
-rw-r--r--usr.bin/xinstall/xinstall.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index 9a2a9918b66e..0148958f7e7e 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -513,11 +513,11 @@ compare(int from_fd, const char *from_name, int to_fd, const char *to_name,
if (tsize <= 8 * 1024 * 1024) {
done_compare = 0;
if (trymmap(from_fd) && trymmap(to_fd)) {
- p = mmap(NULL, tsize, PROT_READ, 0, from_fd, (off_t)0);
- if ((long)p == -1)
+ p = mmap(NULL, tsize, PROT_READ, MAP_SHARED, from_fd, (off_t)0);
+ if (p == (char *)MAP_FAILED)
goto out;
- q = mmap(NULL, tsize, PROT_READ, 0, to_fd, (off_t)0);
- if ((long)q == -1) {
+ q = mmap(NULL, tsize, PROT_READ, MAP_SHARED, to_fd, (off_t)0);
+ if (q == (char *)MAP_FAILED) {
munmap(p, tsize);
goto out;
}
@@ -581,7 +581,7 @@ copy(from_fd, from_name, to_fd, to_name, size)
done_copy = 0;
if (size <= 8 * 1048576 && trymmap(from_fd)) {
if ((p = mmap(NULL, (size_t)size, PROT_READ,
- 0, from_fd, (off_t)0)) == (char *)-1)
+ MAP_SHARED, from_fd, (off_t)0)) == (char *)MAP_FAILED)
goto out;
if ((nw = write(to_fd, p, size)) != size) {
serrno = errno;