git: a97ce14abcf9 - main - correct type of mmap len parameter
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 19 Jan 2022 19:32:51 UTC
The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=a97ce14abcf9252cfb14e9759d4ff2f89a2ca10f commit a97ce14abcf9252cfb14e9759d4ff2f89a2ca10f Author: Wolfram Schneider <wosch@FreeBSD.org> AuthorDate: 2022-01-19 19:20:11 +0000 Commit: Wolfram Schneider <wosch@FreeBSD.org> CommitDate: 2022-01-19 19:32:16 +0000 correct type of mmap len parameter Using locate -m on a database > 2GB should work now. PR: 261277 --- usr.bin/locate/locate/fastfind.c | 4 ++-- usr.bin/locate/locate/locate.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index e2f6d74552ec..a4e12db970a3 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: BSD-4-Clause * - * Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. + * Copyright (c) 1995-2022 Wolfram Schneider <wosch@FreeBSD.org> * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -119,7 +119,7 @@ fastfind_mmap (pathpart, paddr, len, database) char *pathpart; /* search string */ caddr_t paddr; /* mmap pointer */ - int len; /* length of database */ + off_t len; /* length of database */ char *database; /* for error message */ diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c index 29c46b2b78cc..3499591acabc 100644 --- a/usr.bin/locate/locate/locate.c +++ b/usr.bin/locate/locate/locate.c @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: BSD-4-Clause * - * Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin. + * Copyright (c) 1995-2022 Wolfram Schneider <wosch@FreeBSD.org> * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -122,8 +122,8 @@ void usage(void); void statistic(FILE *, char *); void fastfind(FILE *, char *, char *); void fastfind_icase(FILE *, char *, char *); -void fastfind_mmap(char *, caddr_t, int, char *); -void fastfind_mmap_icase(char *, caddr_t, int, char *); +void fastfind_mmap(char *, caddr_t, off_t, char *); +void fastfind_mmap_icase(char *, caddr_t, off_t, char *); void search_mmap(char *, char **); void search_fopen(char *, char **); unsigned long cputime(void); @@ -314,9 +314,9 @@ search_mmap(char *db, char **s) t0 = cputime(); #endif if (f_icase) - fastfind_mmap_icase(*s, p, (int)len, db); + fastfind_mmap_icase(*s, p, len, db); else - fastfind_mmap(*s, p, (int)len, db); + fastfind_mmap(*s, p, len, db); #ifdef DEBUG warnx("fastfind %ld ms", cputime () - t0); #endif