[Midnightbsd-cvs] src [11534] sync with freebsd.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Jul 7 16:33:15 EDT 2018


Revision: 11534
          http://svnweb.midnightbsd.org/src/?rev=11534
Author:   laffer1
Date:     2018-07-07 16:33:14 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
sync with freebsd.

Modified Paths:
--------------
    trunk/usr.bin/locate/Makefile
    trunk/usr.bin/locate/Makefile.inc
    trunk/usr.bin/locate/bigram/Makefile
    trunk/usr.bin/locate/bigram/locate.bigram.c
    trunk/usr.bin/locate/code/Makefile
    trunk/usr.bin/locate/code/locate.code.c
    trunk/usr.bin/locate/locate/Makefile
    trunk/usr.bin/locate/locate/concatdb.sh
    trunk/usr.bin/locate/locate/fastfind.c
    trunk/usr.bin/locate/locate/locate.1
    trunk/usr.bin/locate/locate/locate.c
    trunk/usr.bin/locate/locate/locate.h
    trunk/usr.bin/locate/locate/locate.rc
    trunk/usr.bin/locate/locate/locate.updatedb.8
    trunk/usr.bin/locate/locate/mklocatedb.sh
    trunk/usr.bin/locate/locate/pathnames.h
    trunk/usr.bin/locate/locate/updatedb.sh
    trunk/usr.bin/locate/locate/util.c

Property Changed:
----------------
    trunk/usr.bin/locate/Makefile.inc
    trunk/usr.bin/locate/locate/concatdb.sh
    trunk/usr.bin/locate/locate/locate.1
    trunk/usr.bin/locate/locate/locate.rc
    trunk/usr.bin/locate/locate/locate.updatedb.8
    trunk/usr.bin/locate/locate/mklocatedb.sh
    trunk/usr.bin/locate/locate/updatedb.sh

Modified: trunk/usr.bin/locate/Makefile
===================================================================
--- trunk/usr.bin/locate/Makefile	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/Makefile	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/locate/Makefile 148109 2005-07-17 21:19:28Z wosch $
 
 
 SUBDIR=	bigram code locate

Modified: trunk/usr.bin/locate/Makefile.inc
===================================================================
--- trunk/usr.bin/locate/Makefile.inc	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/Makefile.inc	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,4 +1,5 @@
 # $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/locate/Makefile.inc 201386 2010-01-02 10:27:05Z ed $
 
 LIBEXECDIR?=	/usr/libexec
 


Property changes on: trunk/usr.bin/locate/Makefile.inc
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/locate/bigram/Makefile
===================================================================
--- trunk/usr.bin/locate/bigram/Makefile	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/bigram/Makefile	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,8 +1,9 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/locate/bigram/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 PROG=	locate.bigram
-NO_MAN=
+MAN=
 BINDIR=	${LIBEXECDIR}
 CFLAGS+= -I${.CURDIR}/../locate
 

Modified: trunk/usr.bin/locate/bigram/locate.bigram.c
===================================================================
--- trunk/usr.bin/locate/bigram/locate.bigram.c	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/bigram/locate.bigram.c	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1995 Wolfram Schneider <wosch at FreeBSD.org>. Berlin.
  * Copyright (c) 1989, 1993
@@ -34,7 +35,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/locate/bigram/locate.bigram.c 209571 2010-06-28 12:04:55Z gavin $
  */
 
 #if 0

Modified: trunk/usr.bin/locate/code/Makefile
===================================================================
--- trunk/usr.bin/locate/code/Makefile	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/code/Makefile	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,9 +1,10 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/locate/code/Makefile 276486 2014-12-31 23:25:37Z ngie $
 
 PROG=	locate.code
 CFLAGS+=-I${.CURDIR}/../locate 
-NO_MAN=
+MAN=
 BINDIR=	${LIBEXECDIR}
 
 .include <bsd.prog.mk>

Modified: trunk/usr.bin/locate/code/locate.code.c
===================================================================
--- trunk/usr.bin/locate/code/locate.code.c	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/code/locate.code.c	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1995 Wolfram Schneider <wosch at FreeBSD.org>. Berlin.
  * Copyright (c) 1989, 1993
@@ -34,7 +35,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/locate/code/locate.code.c 209571 2010-06-28 12:04:55Z gavin $
  */
 
 #if 0

Modified: trunk/usr.bin/locate/locate/Makefile
===================================================================
--- trunk/usr.bin/locate/locate/Makefile	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/Makefile	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/locate/locate/Makefile 201386 2010-01-02 10:27:05Z ed $
 
 PROG=	locate
 SRCS=	util.c locate.c

Modified: trunk/usr.bin/locate/locate/concatdb.sh
===================================================================
--- trunk/usr.bin/locate/locate/concatdb.sh	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/concatdb.sh	2018-07-07 20:33:14 UTC (rev 11534)
@@ -31,6 +31,7 @@
 # Sequence of databases is important.
 #
 # $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/locate/locate/concatdb.sh 55835 2000-01-12 08:01:01Z kris $
 
 # The directory containing locate subprograms
 : ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR


Property changes on: trunk/usr.bin/locate/locate/concatdb.sh
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/locate/locate/fastfind.c
===================================================================
--- trunk/usr.bin/locate/locate/fastfind.c	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/fastfind.c	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1995 Wolfram Schneider <wosch at FreeBSD.org>. Berlin.
  * Copyright (c) 1989, 1993
@@ -34,7 +35,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/locate/locate/fastfind.c 229403 2012-01-03 18:51:58Z ed $
  */
 
 
@@ -167,7 +168,7 @@
 
 	/* find optimal (last) char for searching */
 	for (p = pathpart; *p != '\0'; p++)
-		if (index(LOCATE_REG, *p) != NULL)
+		if (strchr(LOCATE_REG, *p) != NULL)
 			break;
 
 	if (*p == '\0')

Modified: trunk/usr.bin/locate/locate/locate.1
===================================================================
--- trunk/usr.bin/locate/locate/locate.1	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/locate.1	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1995 Wolfram Schneider <wosch at FreeBSD.org>. Berlin.
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -31,7 +32,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"	@(#)locate.1	8.1 (Berkeley) 6/6/93
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/locate/locate/locate.1 162792 2006-09-29 15:20:48Z ru $
 .\"
 .Dd August 17, 2006
 .Dt LOCATE 1


Property changes on: trunk/usr.bin/locate/locate/locate.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/locate/locate/locate.c
===================================================================
--- trunk/usr.bin/locate/locate/locate.c	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/locate.c	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1995 Wolfram Schneider <wosch at FreeBSD.org>. Berlin.
  * Copyright (c) 1989, 1993
@@ -47,7 +48,7 @@
 static char sccsid[] = "@(#)locate.c    8.1 (Berkeley) 6/6/93";
 #endif
 static const char rcsid[] =
-  "$MidnightBSD$";
+  "$FreeBSD: stable/10/usr.bin/locate/locate/locate.c 244063 2012-12-10 02:26:01Z eadler $";
 #endif /* not lint */
 
 /*
@@ -188,7 +189,7 @@
 
         /* no (valid) database as argument */
         if (dbv == NULL || *dbv == NULL) {
-                /* try to read database from enviroment */
+                /* try to read database from environment */
                 if ((path_fcodes = getenv("LOCATE_PATH")) == NULL ||
 		     *path_fcodes == '\0')
                         /* use default database */
@@ -292,7 +293,9 @@
 		err(1, "`%s'", db);
 	len = sb.st_size;
 	if (len < (2*NBG))
-		errx(1, "database too small: %s", db);
+		errx(1,
+		    "database too small: %s\nRun /usr/libexec/locate.updatedb",
+		    db);
 
 	if ((p = mmap((caddr_t)0, (size_t)len,
 		      PROT_READ, MAP_SHARED,

Modified: trunk/usr.bin/locate/locate/locate.h
===================================================================
--- trunk/usr.bin/locate/locate/locate.h	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/locate.h	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1995 Wolfram Schneider <wosch at FreeBSD.org>. Berlin.
  * Copyright (c) 1989, 1993
@@ -32,7 +33,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)locate.h	8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/locate/locate/locate.h 215752 2010-11-23 15:08:56Z nwhitehorn $
  */
 
 /* Symbolic constants shared by locate.c and code.c */

Modified: trunk/usr.bin/locate/locate/locate.rc
===================================================================
--- trunk/usr.bin/locate/locate/locate.rc	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/locate.rc	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,7 +1,7 @@
 #
 # /etc/locate.rc -  command script for updatedb(8)
-#
 # $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/locate/locate/locate.rc 294779 2016-01-26 08:44:01Z des $
 
 #
 # All commented values are the defaults
@@ -16,7 +16,7 @@
 #SEARCHPATHS="/"
 
 # paths unwanted in output
-#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap"
+#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update"
 
 # directories unwanted in output
 #PRUNEDIRS=".zfs"


Property changes on: trunk/usr.bin/locate/locate/locate.rc
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/locate/locate/locate.updatedb.8
===================================================================
--- trunk/usr.bin/locate/locate/locate.updatedb.8	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/locate.updatedb.8	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
 .\" Copyright (c) 1996
 .\"	Mike Pritchard <mpp at FreeBSD.org>.  All rights reserved.
 .\"
@@ -28,7 +29,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/locate/locate/locate.updatedb.8 140420 2005-01-18 13:43:56Z ru $
 .\"
 .Dd February 11, 1996
 .Dt LOCATE.UPDATEDB 8


Property changes on: trunk/usr.bin/locate/locate/locate.updatedb.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/locate/locate/mklocatedb.sh
===================================================================
--- trunk/usr.bin/locate/locate/mklocatedb.sh	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/mklocatedb.sh	2018-07-07 20:33:14 UTC (rev 11534)
@@ -28,8 +28,8 @@
 # 
 # usage: mklocatedb [-presort] < filelist > database
 #
+# $FreeBSD: stable/10/usr.bin/locate/locate/mklocatedb.sh 100482 2002-07-22 05:35:59Z tjr $
 # $MidnightBSD$
-
 # The directory containing locate subprograms
 : ${LIBEXECDIR:=/usr/libexec}; export LIBEXECDIR
 


Property changes on: trunk/usr.bin/locate/locate/mklocatedb.sh
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/locate/locate/pathnames.h
===================================================================
--- trunk/usr.bin/locate/locate/pathnames.h	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/pathnames.h	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.

Modified: trunk/usr.bin/locate/locate/updatedb.sh
===================================================================
--- trunk/usr.bin/locate/locate/updatedb.sh	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/updatedb.sh	2018-07-07 20:33:14 UTC (rev 11534)
@@ -27,6 +27,7 @@
 # updatedb - update locate database for local mounted filesystems
 #
 # $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/locate/locate/updatedb.sh 294779 2016-01-26 08:44:01Z des $
 
 if [ "$(id -u)" = "0" ]; then
 	echo ">>> WARNING" 1>&2
@@ -51,7 +52,7 @@
 : ${mklocatedb:=locate.mklocatedb}	 # make locate database program
 : ${FCODES:=/var/db/locate.database}	 # the database
 : ${SEARCHPATHS="/"}		# directories to be put in the database
-: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories
+: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update"} # unwanted directories
 : ${PRUNEDIRS=".zfs"}	# unwanted directories, in any parent
 : ${FILESYSTEMS="$(lsvfs | tail -n +3 | \
 	egrep -vw "loopback|network|synthetic|read-only|0" | \


Property changes on: trunk/usr.bin/locate/locate/updatedb.sh
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/locate/locate/util.c
===================================================================
--- trunk/usr.bin/locate/locate/util.c	2018-07-07 20:31:07 UTC (rev 11533)
+++ trunk/usr.bin/locate/locate/util.c	2018-07-07 20:33:14 UTC (rev 11534)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 1995 Wolfram Schneider <wosch at FreeBSD.org>. Berlin.
  * Copyright (c) 1989, 1993
@@ -34,7 +35,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/locate/locate/util.c 275034 2014-11-25 12:45:31Z dim $
  */
 
 
@@ -162,7 +163,7 @@
 
 	/* skip trailing metacharacters */
 	for (; p >= name; p--)
-		if (index(LOCATE_REG, *p) == NULL)
+		if (strchr(LOCATE_REG, *p) == NULL)
 			break;
 
 	/* 
@@ -172,7 +173,7 @@
 	 *        |----< p
 	 */
 	if (p >= name && 
-	    (index(p, '[') != NULL || index(p, ']') != NULL)) {
+	    (strchr(p, '[') != NULL || strchr(p, ']') != NULL)) {
 		for (p = name; *p != '\0'; p++)
 			if (*p == ']' || *p == '[')
 				break;
@@ -183,7 +184,7 @@
 		 * '*\*[a-z]'
 		 *    |-------< p
 		 */
-		if (p >= name && index(LOCATE_REG, *p) != NULL)
+		if (p >= name && strchr(LOCATE_REG, *p) != NULL)
 			p = name - 1;
 	}
 	
@@ -193,7 +194,7 @@
 
 	else {
 		for (endmark = p; p >= name; p--)
-			if (index(LOCATE_REG, *p) != NULL)
+			if (strchr(LOCATE_REG, *p) != NULL)
 				break;
 		for (++p;
 		    (p <= endmark) && subp < (globfree + sizeof(globfree));)
@@ -218,16 +219,16 @@
 
 
 /*
- * Read integer from mmap pointer. 
- * Essential a simple  ``return *(int *)p'' but avoid sigbus 
+ * Read integer from mmap pointer.
+ * Essentially a simple ``return *(int *)p'' but avoids sigbus
  * for integer alignment (SunOS 4.x, 5.x).
  *
- * Convert network byte order to host byte order if neccessary. 
- * So we can read on FreeBSD/i386 (little endian) a locate database
+ * Convert network byte order to host byte order if necessary.
+ * So we can read a locate database on FreeBSD/i386 (little endian)
  * which was built on SunOS/sparc (big endian).
  */
 
-int 
+int
 getwm(p)
 	caddr_t p;
 {
@@ -235,7 +236,7 @@
 		char buf[INTSIZE];
 		int i;
 	} u;
-	register int i;
+	register int i, hi;
 
 	for (i = 0; i < (int)INTSIZE; i++)
 		u.buf[i] = *p++;
@@ -243,10 +244,11 @@
 	i = u.i;
 
 	if (i > MAXPATHLEN || i < -(MAXPATHLEN)) {
-		i = ntohl(i);
-		if (i > MAXPATHLEN || i < -(MAXPATHLEN))
+		hi = ntohl(i);
+		if (hi > MAXPATHLEN || hi < -(MAXPATHLEN))
 			errx(1, "integer out of +-MAXPATHLEN (%d): %u",
-			    MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
+			    MAXPATHLEN, abs(i) < abs(hi) ? i : hi);
+		return(hi);
 	}
 	return(i);
 }
@@ -254,7 +256,7 @@
 /*
  * Read integer from stream.
  *
- * Convert network byte order to host byte order if neccessary. 
+ * Convert network byte order to host byte order if necessary.
  * So we can read on FreeBSD/i386 (little endian) a locate database
  * which was built on SunOS/sparc (big endian).
  */
@@ -263,16 +265,16 @@
 getwf(fp)
 	FILE *fp;
 {
-	register int word;
+	register int word, hword;
 
 	word = getw(fp);
 
 	if (word > MAXPATHLEN || word < -(MAXPATHLEN)) {
-		word = ntohl(word);
-		if (word > MAXPATHLEN || word < -(MAXPATHLEN))
+		hword = ntohl(word);
+		if (hword > MAXPATHLEN || hword < -(MAXPATHLEN))
 			errx(1, "integer out of +-MAXPATHLEN (%d): %u",
-			    MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
-				htonl(word));
+			    MAXPATHLEN, abs(word) < abs(hword) ? word : hword);
+		return(hword);
 	}
 	return(word);
 }



More information about the Midnightbsd-cvs mailing list