CVS commit: src/tests/lib/libc/gen

2011-04-17 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Apr 17 06:18:23 UTC 2011

Modified Files:
src/tests/lib/libc/gen: Makefile t_nice.c

Log Message:
Test nice(3) also with threads.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/gen/t_nice.c

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

Modified files:

Index: src/tests/lib/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.18 src/tests/lib/libc/gen/Makefile:1.19
--- src/tests/lib/libc/gen/Makefile:1.18	Sun Apr 10 06:27:21 2011
+++ src/tests/lib/libc/gen/Makefile	Sun Apr 17 06:18:23 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2011/04/10 06:27:21 jruoho Exp $
+# $NetBSD: Makefile,v 1.19 2011/04/17 06:18:23 jruoho Exp $
 
 .include bsd.own.mk
 
@@ -22,6 +22,7 @@
 TESTS_C+=	t_vis
 
 LDADD.t_ldexp+=		-lm
+LDADD.t_nice+=		-lpthread
 LDADD.t_syslog_pthread+=-lpthread
 
 .include bsd.test.mk

Index: src/tests/lib/libc/gen/t_nice.c
diff -u src/tests/lib/libc/gen/t_nice.c:1.4 src/tests/lib/libc/gen/t_nice.c:1.5
--- src/tests/lib/libc/gen/t_nice.c:1.4	Sun Apr 10 10:59:13 2011
+++ src/tests/lib/libc/gen/t_nice.c	Sun Apr 17 06:18:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_nice.c,v 1.4 2011/04/10 10:59:13 jruoho Exp $ */
+/*	$NetBSD: t_nice.c,v 1.5 2011/04/17 06:18:23 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_nice.c,v 1.4 2011/04/10 10:59:13 jruoho Exp $);
+__RCSID($NetBSD: t_nice.c,v 1.5 2011/04/17 06:18:23 jruoho Exp $);
 
 #include sys/resource.h
 #include sys/wait.h
@@ -37,9 +37,29 @@
 #include atf-c.h
 #include errno.h
 #include limits.h
+#include pthread.h
 #include stdlib.h
 #include unistd.h
 
+static void	*threadfunc(void *);
+
+static void *
+threadfunc(void *arg)
+{
+	int pri, val;
+
+	val = *(int *)arg;
+
+	errno = 0;
+	pri = getpriority(PRIO_PROCESS, 0);
+	ATF_REQUIRE(errno == 0);
+
+	if (pri != val)
+		atf_tc_fail(nice(3) value was not propagated to threads);
+
+	return NULL;
+}
+
 ATF_TC(nice_err);
 ATF_TC_HEAD(nice_err, tc)
 {
@@ -137,12 +157,42 @@
 	}
 }
 
+ATF_TC(nice_thread);
+ATF_TC_HEAD(nice_thread, tc)
+{
+	atf_tc_set_md_var(tc, descr, Test nice(3) with threads);
+}
+
+ATF_TC_BODY(nice_thread, tc)
+{
+	pthread_t tid[5];
+	int rv, val;
+	size_t i;
+
+	/*
+	 * Test that the scheduling priority is
+	 * propagated to all system scope threads.
+	 */
+	for (i = 0; i  __arraycount(tid); i++) {
+
+		val = nice(i);
+		ATF_REQUIRE(val != -1);
+
+		rv = pthread_create(tid[i], NULL, threadfunc, val);
+		ATF_REQUIRE(rv == 0);
+
+		rv = pthread_join(tid[i], NULL);
+		ATF_REQUIRE(rv == 0);
+	}
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, nice_err);
 	ATF_TP_ADD_TC(tp, nice_priority);
 	ATF_TP_ADD_TC(tp, nice_root);
+	ATF_TP_ADD_TC(tp, nice_thread);
 
 	return atf_no_error();
 }



CVS commit: src/distrib/sets/lists

2011-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 17 09:01:58 UTC 2011

Modified Files:
src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.sparc64
src/distrib/sets/lists/comp: ad.mips64eb md.amd64 md.sparc64 mi shl.mi

Log Message:
various updates to deal with heimdal update.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/distrib/sets/lists/base/ad.mips64eb
cvs rdiff -u -r1.43 -r1.44 src/distrib/sets/lists/base/ad.mips64el
cvs rdiff -u -r1.111 -r1.112 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.26 -r1.27 src/distrib/sets/lists/comp/ad.mips64eb
cvs rdiff -u -r1.108 -r1.109 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.91 -r1.92 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.1617 -r1.1618 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.166 -r1.167 src/distrib/sets/lists/comp/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/ad.mips64eb
diff -u src/distrib/sets/lists/base/ad.mips64eb:1.45 src/distrib/sets/lists/base/ad.mips64eb:1.46
--- src/distrib/sets/lists/base/ad.mips64eb:1.45	Thu Mar 24 17:05:40 2011
+++ src/distrib/sets/lists/base/ad.mips64eb	Sun Apr 17 09:01:57 2011
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64eb,v 1.45 2011/03/24 17:05:40 bouyer Exp $
+# $NetBSD: ad.mips64eb,v 1.46 2011/04/17 09:01:57 mrg Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -53,8 +53,8 @@
 ./usr/lib/64/libamu.so.4.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libarchive.so.3			base-compat-shlib	compat,pic
 ./usr/lib/64/libarchive.so.3.1			base-compat-shlib	compat,pic
-./usr/lib/64/libasn1.so.8			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libasn1.so.8.0			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libasn1.so.9			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libasn1.so.9.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libbfd.so.11			base-compat-shlib	compat,pic,binutils
 ./usr/lib/64/libbfd.so.11.0			base-compat-shlib	compat,pic,binutils
 ./usr/lib/64/libbind9.so.5			base-compat-shlib	compat,pic
@@ -67,8 +67,8 @@
 ./usr/lib/64/libbz2.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libc.so.12base-compat-shlib	compat,pic
 ./usr/lib/64/libc.so.12.177			base-compat-shlib	compat,pic
-./usr/lib/64/libcom_err.so.6			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libcom_err.so.6.0			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libcom_err.so.7			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libcom_err.so.7.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libcrypt.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libcrypt.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libcrypto.so.6			base-compat-shlib	compat,pic,crypto
@@ -101,14 +101,16 @@
 ./usr/lib/64/libgcc_s.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libgnumalloc.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libgnumalloc.so.1.0		base-compat-shlib	compat,pic
-./usr/lib/64/libgssapi.so.9			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libgssapi.so.9.0			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libhdb.so.13			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libhdb.so.13.0			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libheimntlm.so.3			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libheimntlm.so.3.0			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libhx509.so.4			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libhx509.so.4.0			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libgssapi.so.10			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libgssapi.so.10.0			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libhdb.so.14			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libhdb.so.14.0			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libheimbase.so.1			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libheimbase.so.1.0			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libheimntlm.so.4			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libheimntlm.so.4.0			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libhx509.so.5			base-compat-shlib	compat,pic,kerberos
+./usr/lib/64/libhx509.so.5.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libintl.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libintl.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libipsec.so.3			base-compat-shlib	compat,pic
@@ -123,14 +125,16 @@
 ./usr/lib/64/libiscsi.so.2.0			base-compat-shlib	compat,pic,iscsi
 ./usr/lib/64/libisns.so.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libisns.so.0.0			base-compat-shlib	compat,pic
-./usr/lib/64/libkadm5clnt.so.12			base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libkadm5clnt.so.12.0		base-compat-shlib	compat,pic,kerberos
-./usr/lib/64/libkadm5srv.so.13			base-compat-shlib	compat,pic,kerberos

CVS commit: src/share/mk

2011-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 17 09:47:41 UTC 2011

Modified Files:
src/share/mk: bsd.kmodule.mk

Log Message:
prepare for evbppc modules, and allow overriding the ${MACHINE} for
installed modules.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/share/mk/bsd.kmodule.mk

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

Modified files:

Index: src/share/mk/bsd.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.27 src/share/mk/bsd.kmodule.mk:1.28
--- src/share/mk/bsd.kmodule.mk:1.27	Sun Jan  2 19:24:47 2011
+++ src/share/mk/bsd.kmodule.mk	Sun Apr 17 09:47:40 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.27 2011/01/02 19:24:47 matt Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.28 2011/04/17 09:47:40 mrg Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -36,6 +36,29 @@
 CFLAGS+=	-mlongcall
 .endif
 
+# evbppc needs some special help
+.if ${MACHINE} == evbppc
+
+. ifndef PPC_INTR_IMPL
+PPC_INTR_IMPL=\powerpc/intr.h\
+. endif
+. ifndef PPC_PCI_MACHDEP_IMPL
+PPC_PCI_MACHDEP_IMPL=\powerpc/pci_machdep.h\
+. endif
+CPPFLAGS+=  -DPPC_INTR_IMPL=${PPC_INTR_IMPL}
+CPPFLAGS+=  -DPPC_PCI_MACHDEP_IMPL=${DPPC_PCI_MACHDEP_IMPL}
+
+. ifdef PPC_IBM4XX
+CPPFLAGS+=  -DPPC_IBM4XX
+. elifdef PPC_BOOKE
+CPPFLAGS+=  -DPPC_BOOKE
+. else
+CPPFLAGS+=  -DPPC_OEA
+. endif
+
+.endif
+
+
 _YKMSRCS=	${SRCS:M*.[ly]:C/\..$/.c/} ${YHEADER:D${SRCS:M*.y:.y=.h}}
 DPSRCS+=	${_YKMSRCS}
 CLEANFILES+=	${_YKMSRCS}
@@ -64,10 +87,11 @@
 .if !defined(KMODULEDIR)
 _OSRELEASE!=	${HOST_SH} $S/conf/osrelease.sh
 # Ensure these are recorded properly in METALOG on unprived installes:
-_INST_DIRS=	${DESTDIR}/stand/${MACHINE}
-_INST_DIRS+=	${DESTDIR}/stand/${MACHINE}/${_OSRELEASE}
-_INST_DIRS+=	${DESTDIR}/stand/${MACHINE}/${_OSRELEASE}/modules
-KMODULEDIR=	${DESTDIR}/stand/${MACHINE}/${_OSRELEASE}/modules/${KMOD}
+KMODULEARCHDIR?= ${MACHINE}
+_INST_DIRS=	${DESTDIR}/stand/${KMODULEARCHDIR}
+_INST_DIRS+=	${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE}
+_INST_DIRS+=	${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE}/modules
+KMODULEDIR=	${DESTDIR}/stand/${KMODULEARCHDIR}/${_OSRELEASE}/modules/${KMOD}
 .endif
 _PROG:=		${KMODULEDIR}/${PROG} # installed path
 



CVS commit: src/sys/arch/xen/include

2011-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 17 09:50:33 UTC 2011

Modified Files:
src/sys/arch/xen/include: xen.h xenpmap.h

Log Message:
apply some _KERNEL_OPT.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/xen/include/xen.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/include/xenpmap.h

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

Modified files:

Index: src/sys/arch/xen/include/xen.h
diff -u src/sys/arch/xen/include/xen.h:1.32 src/sys/arch/xen/include/xen.h:1.33
--- src/sys/arch/xen/include/xen.h:1.32	Wed Jul 29 12:02:06 2009
+++ src/sys/arch/xen/include/xen.h	Sun Apr 17 09:50:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen.h,v 1.32 2009/07/29 12:02:06 cegger Exp $	*/
+/*	$NetBSD: xen.h,v 1.33 2011/04/17 09:50:33 mrg Exp $	*/
 
 /*
  *
@@ -27,7 +27,10 @@
 
 #ifndef _XEN_H
 #define _XEN_H
+
+#ifdef _KERNEL_OPT
 #include opt_xen.h
+#endif
 
 
 #ifndef _LOCORE

Index: src/sys/arch/xen/include/xenpmap.h
diff -u src/sys/arch/xen/include/xenpmap.h:1.25 src/sys/arch/xen/include/xenpmap.h:1.26
--- src/sys/arch/xen/include/xenpmap.h:1.25	Thu Feb 10 00:23:14 2011
+++ src/sys/arch/xen/include/xenpmap.h	Sun Apr 17 09:50:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenpmap.h,v 1.25 2011/02/10 00:23:14 jym Exp $	*/
+/*	$NetBSD: xenpmap.h,v 1.26 2011/04/17 09:50:33 mrg Exp $	*/
 
 /*
  *
@@ -29,7 +29,10 @@
 
 #ifndef _XEN_XENPMAP_H_
 #define _XEN_XENPMAP_H_
+
+#ifdef _KERNEL_OPT
 #include opt_xen.h
+#endif
 
 #define	INVALID_P2M_ENTRY	(~0UL)
 



CVS commit: src/distrib/sets/lists/comp

2011-04-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Apr 17 10:06:49 UTC 2011

Modified Files:
src/distrib/sets/lists/comp: ad.mips64el

Log Message:
catch up with heimdal update.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/sets/lists/comp/ad.mips64el

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

Modified files:

Index: src/distrib/sets/lists/comp/ad.mips64el
diff -u src/distrib/sets/lists/comp/ad.mips64el:1.26 src/distrib/sets/lists/comp/ad.mips64el:1.27
--- src/distrib/sets/lists/comp/ad.mips64el:1.26	Thu Mar 24 17:05:41 2011
+++ src/distrib/sets/lists/comp/ad.mips64el	Sun Apr 17 10:06:49 2011
@@ -1,5 +1,5 @@
-# $NetBSD: ad.mips64el,v 1.26 2011/03/24 17:05:41 bouyer Exp $
-./usr/bin/elf2aoutcomp-obsolete	obsolete
+# $NetBSD: ad.mips64el,v 1.27 2011/04/17 10:06:49 mrg Exp $
+./usr/bin/elf2aoutcomp-obsolete		obsolete
 ./usr/bin/elf2ecoffcomp-sysutil-bin
 ./usr/include/mipscomp-c-include
 ./usr/include/mips/ansi.h			comp-c-include
@@ -296,6 +296,11 @@
 ./usr/lib/64/libhdb.sobase-sys-shlib		compat,pic,kerberos
 ./usr/lib/64/libhdb_p.acomp-c-proflib		compat,profile,kerberos
 ./usr/lib/64/libhdb_pic.a			comp-c-piclib		compat,pic,kerberos
+./usr/lib/64/libheimbase.a			comp-c-lib		compat,kerberos
+./usr/lib/64/libheimbase.so			comp-sys-shlib		compat,pic,kerberos
+./usr/lib/64/libheimbase_g.a			comp-c-proflib		compat,debuglib,kerberos
+./usr/lib/64/libheimbase_p.a			comp-c-proflib		compat,profile,kerberos
+./usr/lib/64/libheimbase_pic.a			comp-c-proflib		compat,pic,kerberos
 ./usr/lib/64/libheimntlm.a			comp-c-lib		compat,kerberos
 ./usr/lib/64/libheimntlm.so			base-sys-shlib		compat,pic,kerberos
 ./usr/lib/64/libheimntlm_p.a			comp-c-proflib		compat,profile,kerberos
@@ -347,6 +352,11 @@
 ./usr/lib/64/libkafs.sobase-sys-shlib		compat,pic,kerberos
 ./usr/lib/64/libkafs_p.a			comp-c-proflib		compat,profile,kerberos
 ./usr/lib/64/libkafs_pic.a			comp-c-piclib		compat,pic,kerberos
+./usr/lib/64/libkdc.acomp-c-lib		compat,kerberos
+./usr/lib/64/libkdc.socomp-sys-shlib		compat,pic,kerberos
+./usr/lib/64/libkdc_g.acomp-c-proflib		compat,debuglib,kerberos
+./usr/lib/64/libkdc_p.acomp-c-proflib		compat,profile,kerberos
+./usr/lib/64/libkdc_pic.a			comp-c-proflib		compat,pic,kerberos
 ./usr/lib/64/libkrb5.acomp-c-lib		compat,kerberos
 ./usr/lib/64/libkrb5.sobase-sys-shlib		compat,pic,kerberos
 ./usr/lib/64/libkrb5_p.a			comp-c-proflib		compat,profile,kerberos
@@ -497,7 +507,7 @@
 ./usr/lib/64/librumpclient.a			comp-c-lib		compat
 ./usr/lib/64/librumpclient.so			base-sys-shlib		compat,pic
 ./usr/lib/64/librumpclient_p.a			comp-c-proflib		compat,profile
-./usr/lib/64/librumpclient_pic.a			comp-c-piclib		compat,pic
+./usr/lib/64/librumpclient_pic.a		comp-c-piclib		compat,pic
 ./usr/lib/64/librumpcrypto.a			comp-obsolete		obsolete
 ./usr/lib/64/librumpcrypto.so			base-obsolete		obsolete
 ./usr/lib/64/librumpcrypto_p.a			comp-obsolete		obsolete
@@ -536,10 +546,10 @@
 ./usr/lib/64/libsl.sobase-sys-shlib		compat,pic,kerberos
 ./usr/lib/64/libsl_p.acomp-c-proflib		compat,profile,kerberos
 ./usr/lib/64/libsl_pic.a			comp-c-piclib		compat,pic,kerberos
-./usr/lib/64/libss.acomp-c-lib		compat,kerberos
-./usr/lib/64/libss.sobase-sys-shlib		compat,pic,kerberos
-./usr/lib/64/libss_p.acomp-c-proflib		compat,profile,kerberos
-./usr/lib/64/libss_pic.a			comp-c-piclib		compat,pic,kerberos
+./usr/lib/64/libss.acomp-c-lib		obsolete
+./usr/lib/64/libss.sobase-sys-shlib		obsolete
+./usr/lib/64/libss_p.acomp-c-proflib		obsolete
+./usr/lib/64/libss_pic.a			comp-c-piclib		obsolete
 ./usr/lib/64/libssh.acomp-c-lib		compat,crypto
 ./usr/lib/64/libssh.sobase-sys-shlib		compat,crypto,pic
 ./usr/lib/64/libssh_p.acomp-c-proflib		compat,crypto,profile
@@ -582,6 +592,11 @@
 ./usr/lib/64/libvers.acomp-obsolete		obsolete
 ./usr/lib/64/libvers_p.a			comp-obsolete		obsolete
 ./usr/lib/64/libvers_pic.a			comp-obsolete		obsolete
+./usr/lib/64/libwind.acomp-c-lib		compat,kerberos
+./usr/lib/64/libwind.socomp-sys-shlib		compat,pic,kerberos
+./usr/lib/64/libwind_g.a			comp-c-proflib		compat,debuglib,kerberos
+./usr/lib/64/libwind_p.a			comp-c-proflib		compat,profile,kerberos
+./usr/lib/64/libwind_pic.a			comp-c-piclib		compat,pic,kerberos
 ./usr/lib/64/libwrap.acomp-c-lib		compat
 ./usr/lib/64/libwrap.sobase-sys-shlib		compat,pic
 ./usr/lib/64/libwrap_p.a			comp-c-proflib		compat,profile
@@ -830,6 +845,11 @@
 ./usr/lib/o32/libhdb.sobase-sys-shlib		compat,pic,kerberos
 ./usr/lib/o32/libhdb_p.a			comp-c-proflib		compat,profile,kerberos
 ./usr/lib/o32/libhdb_pic.a			comp-c-piclib		compat,pic,kerberos
+./usr/lib/o32/libheimbase.a			comp-c-lib		compat,kerberos
+./usr/lib/o32/libheimbase.so			comp-sys-shlib		compat,pic,kerberos
+./usr/lib/o32/libheimbase_g.a			comp-c-proflib		compat,debuglib,kerberos
+./usr/lib/o32/libheimbase_p.a			

CVS commit: src/external/bsd/tcpdump/dist

2011-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 17 11:45:40 UTC 2011

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.c

Log Message:
Hint from dsl: make sure to have the /etc/protocols file already open
before doing a chroot() if run as root. Easily done by a setprotoent(1)
call. This is a better (less intrusive) fix for PR bin/44721.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tcpdump/dist/tcpdump.c

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

Modified files:

Index: src/external/bsd/tcpdump/dist/tcpdump.c
diff -u src/external/bsd/tcpdump/dist/tcpdump.c:1.2 src/external/bsd/tcpdump/dist/tcpdump.c:1.3
--- src/external/bsd/tcpdump/dist/tcpdump.c:1.2	Sun Dec  5 05:11:31 2010
+++ src/external/bsd/tcpdump/dist/tcpdump.c	Sun Apr 17 11:45:40 2011
@@ -34,7 +34,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.283 2008-09-25 21:45:50 guy Exp (LBL);
 #else
-__RCSID($NetBSD: tcpdump.c,v 1.2 2010/12/05 05:11:31 christos Exp $);
+__RCSID($NetBSD: tcpdump.c,v 1.3 2011/04/17 11:45:40 martin Exp $);
 #endif
 #endif
 
@@ -469,6 +469,7 @@
 	pw = getpwnam(username);
 	if (pw) {
 		if (chroot_dir) {
+			setprotoent(1);
 			if (chroot(chroot_dir) != 0 || chdir (/) != 0) {
 fprintf(stderr, tcpdump: Couldn't chroot/chdir to '%.64s': %s\n,
 chroot_dir, pcap_strerror(errno));



CVS commit: src/distrib

2011-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 17 12:18:20 UTC 2011

Modified Files:
src/distrib/amd64/cdroms: Makefile.cdrom install.sh
src/distrib/i386/cdroms: Makefile.cdrom install.sh
src/distrib/sparc64/cdroms/installcd: Makefile install.sh
src/distrib/sparc64/instfs: dot.profile

Log Message:
On install CDs: make ^C and ^Z work (mostly) as they used to do on
crunched/ramdisk install media again.
Fixes the remaining parts of PR 44738.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amd64/cdroms/Makefile.cdrom
cvs rdiff -u -r1.1 -r1.2 src/distrib/amd64/cdroms/install.sh
cvs rdiff -u -r1.23 -r1.24 src/distrib/i386/cdroms/Makefile.cdrom
cvs rdiff -u -r1.1 -r1.2 src/distrib/i386/cdroms/install.sh
cvs rdiff -u -r1.10 -r1.11 src/distrib/sparc64/cdroms/installcd/Makefile
cvs rdiff -u -r1.1 -r1.2 src/distrib/sparc64/cdroms/installcd/install.sh
cvs rdiff -u -r1.5 -r1.6 src/distrib/sparc64/instfs/dot.profile

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

Modified files:

Index: src/distrib/amd64/cdroms/Makefile.cdrom
diff -u src/distrib/amd64/cdroms/Makefile.cdrom:1.3 src/distrib/amd64/cdroms/Makefile.cdrom:1.4
--- src/distrib/amd64/cdroms/Makefile.cdrom:1.3	Sat Jan 29 01:54:33 2011
+++ src/distrib/amd64/cdroms/Makefile.cdrom	Sun Apr 17 12:18:19 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.3 2011/01/29 01:54:33 jym Exp $
+# $NetBSD: Makefile.cdrom,v 1.4 2011/04/17 12:18:19 martin Exp $
 
 .include bsd.own.mk
 
@@ -34,6 +34,7 @@
 CDRUNTIME+=	./usr/bin/sed
 CDRUNTIME+=	./usr/bin/sort
 CDRUNTIME+=	./usr/bin/tip
+CDRUNTIME+=	./usr/bin/tput
 CDRUNTIME+=	./usr/bin/vmstat
 CDRUNTIME+=	./usr/lib/libbz2.so*
 CDRUNTIME+=	./usr/lib/libc.so*

Index: src/distrib/amd64/cdroms/install.sh
diff -u src/distrib/amd64/cdroms/install.sh:1.1 src/distrib/amd64/cdroms/install.sh:1.2
--- src/distrib/amd64/cdroms/install.sh:1.1	Tue Jan 18 00:16:13 2011
+++ src/distrib/amd64/cdroms/install.sh	Sun Apr 17 12:18:20 2011
@@ -1,5 +1,5 @@
-#! /bin/sh
-# $NetBSD: install.sh,v 1.1 2011/01/18 00:16:13 jym Exp $
+#! /bin/sh -m
+# $NetBSD: install.sh,v 1.2 2011/04/17 12:18:20 martin Exp $
 #
 # -
 #  Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -34,17 +34,23 @@
 PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
 export PATH
 
+termfile=/tmp/sysinst.term
+
 # Check if we are on a framebuffer or on serial console and default
 # the terminal type accordingly.
 # There is no /var/db/dev.db, so sysctl might not map the devicename properly;
 # ttyE0 is 90,0 - 0x5a00
 case $(sysctl -nx kern.consdev) in
  002f)
-   TERM=wsvt25
-   ;;
+TERM=wsvt25
+;;
  *)
-   TERM=vt220
-   ;;
+if [ -r ${termfile} ]; then
+	. ${termfile}
+else
+	TERM=vt220
+fi
+;;
 esac
 
 export TERM
@@ -54,6 +60,8 @@
 export BLOCKSIZE
 EDITOR=ed
 export EDITOR
+SHELL=/bin/sh
+export SHELL
 
 umask 022
 
@@ -78,8 +86,30 @@
 fi
 
 # run the installation or upgrade script.
-/sysinst || {
-	echo Oops, something went wrong - we will try again; exit; }
+cd /
+cmd=./sysinst
+
+while [ -n ${cmd} ]
+do
+	${cmd}
+	if [ $? = 4 ]; then
+		echo Oops, something went wrong - we will try again
+		exit
+	else
+		if [ -n $(jobs) ]; then
+			tput clear
+			echo You have stopped sysinst, return to it by \
+typing 'exit' or ^D.
+			${SHELL} -i
+			cmd=fg
+		else
+			cmd=
+		fi
+	fi
+done
 
+# remember terminal type, now that we know it for sure
+echo TERM=${TERM}  ${termfile}
+echo
 echo To return to the installer, quit this shell by typing 'exit' or ^D.
-exec /bin/sh
+exec ${SHELL}

Index: src/distrib/i386/cdroms/Makefile.cdrom
diff -u src/distrib/i386/cdroms/Makefile.cdrom:1.23 src/distrib/i386/cdroms/Makefile.cdrom:1.24
--- src/distrib/i386/cdroms/Makefile.cdrom:1.23	Thu Jan 27 15:34:38 2011
+++ src/distrib/i386/cdroms/Makefile.cdrom	Sun Apr 17 12:18:20 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.23 2011/01/27 15:34:38 gdt Exp $
+# $NetBSD: Makefile.cdrom,v 1.24 2011/04/17 12:18:20 martin Exp $
 
 .include bsd.own.mk
 
@@ -34,6 +34,7 @@
 CDRUNTIME+=	./usr/bin/sed
 CDRUNTIME+=	./usr/bin/sort
 CDRUNTIME+=	./usr/bin/tip
+CDRUNTIME+=	./usr/bin/tput
 CDRUNTIME+=	./usr/bin/vmstat
 CDRUNTIME+=	./usr/lib/libbz2.so*
 CDRUNTIME+=	./usr/lib/libc.so*

Index: src/distrib/i386/cdroms/install.sh
diff -u src/distrib/i386/cdroms/install.sh:1.1 src/distrib/i386/cdroms/install.sh:1.2
--- src/distrib/i386/cdroms/install.sh:1.1	Mon Apr 19 04:41:36 2010
+++ src/distrib/i386/cdroms/install.sh	Sun Apr 17 12:18:20 2011
@@ -1,5 +1,5 @@
-#! /bin/sh
-# $NetBSD: install.sh,v 1.1 2010/04/19 04:41:36 martin Exp $
+#! /bin/sh -m
+# $NetBSD: install.sh,v 1.2 2011/04/17 12:18:20 martin Exp $
 #
 # -
 #  Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -34,17 +34,23 @@
 PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
 export PATH
 
+termfile=/tmp/sysinst.term
+
 # Check if we are on a framebuffer or on serial console and default
 # the terminal type 

CVS commit: src/distrib/utils/sysinst

2011-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 17 12:33:42 UTC 2011

Modified Files:
src/distrib/utils/sysinst: menus.mi msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl

Log Message:
Add an exitstring to the utility menu, so translations can provide
proper strings (like: back to main menu). For most translations set
to plain Exit (like it used to be) for now - natives, please fix!


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/distrib/utils/sysinst/menus.mi
cvs rdiff -u -r1.56 -r1.57 src/distrib/utils/sysinst/msg.mi.de
cvs rdiff -u -r1.164 -r1.165 src/distrib/utils/sysinst/msg.mi.en
cvs rdiff -u -r1.34 -r1.35 src/distrib/utils/sysinst/msg.mi.es
cvs rdiff -u -r1.114 -r1.115 src/distrib/utils/sysinst/msg.mi.fr
cvs rdiff -u -r1.73 -r1.74 src/distrib/utils/sysinst/msg.mi.pl

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

Modified files:

Index: src/distrib/utils/sysinst/menus.mi
diff -u src/distrib/utils/sysinst/menus.mi:1.41 src/distrib/utils/sysinst/menus.mi:1.42
--- src/distrib/utils/sysinst/menus.mi:1.41	Fri Apr  8 15:53:44 2011
+++ src/distrib/utils/sysinst/menus.mi	Sun Apr 17 12:33:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: menus.mi,v 1.41 2011/04/08 15:53:44 martin Exp $	*/
+/*	$NetBSD: menus.mi,v 1.42 2011/04/17 12:33:42 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -163,7 +163,8 @@
 		action (endwin) { system(/sbin/reboot -q); };
 	option MSG_Utility_menu, sub menu utility;
 
-menu utility, title MSG_NetBSD_VERSION_Utilities, exit;
+menu utility, title MSG_NetBSD_VERSION_Utilities, exit,
+		exitstring MSG_exit_utility_menu;
 	display action  { toplevel(); };
 	option MSG_Run_bin_sh,
 		action (endwin) { system(/bin/sh); };

Index: src/distrib/utils/sysinst/msg.mi.de
diff -u src/distrib/utils/sysinst/msg.mi.de:1.56 src/distrib/utils/sysinst/msg.mi.de:1.57
--- src/distrib/utils/sysinst/msg.mi.de:1.56	Mon Apr  4 08:30:13 2011
+++ src/distrib/utils/sysinst/msg.mi.de	Sun Apr 17 12:33:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.56 2011/04/04 08:30:13 mbalmer Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.57 2011/04/17 12:33:42 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -934,6 +934,7 @@
 message Re_install_sets_or_install_additional_sets {Erneute Installation oder zusätzliche Pakete installieren}
 message Reboot_the_computer {Computer neu starten}
 message Utility_menu {Extras}
+message exit_utility_menu {Zurück zum Hauptmenü}
 message NetBSD_VERSION_Utilities {NetBSD-@@VERSION@@ Extras}
 message Run_bin_sh {Ausführen von /bin/sh}
 message Set_timezone {Setzen der Zeitzone}

Index: src/distrib/utils/sysinst/msg.mi.en
diff -u src/distrib/utils/sysinst/msg.mi.en:1.164 src/distrib/utils/sysinst/msg.mi.en:1.165
--- src/distrib/utils/sysinst/msg.mi.en:1.164	Mon Apr  4 08:30:13 2011
+++ src/distrib/utils/sysinst/msg.mi.en	Sun Apr 17 12:33:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.164 2011/04/04 08:30:13 mbalmer Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.165 2011/04/17 12:33:42 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -874,6 +874,7 @@
 message Re_install_sets_or_install_additional_sets {Re-install sets or install additional sets}
 message Reboot_the_computer {Reboot the computer}
 message Utility_menu {Utility menu}
+message exit_utility_menu {Back to main menu}
 message NetBSD_VERSION_Utilities {NetBSD-@@VERSION@@ Utilities}
 message Run_bin_sh {Run /bin/sh}
 message Set_timezone {Set timezone}

Index: src/distrib/utils/sysinst/msg.mi.es
diff -u src/distrib/utils/sysinst/msg.mi.es:1.34 src/distrib/utils/sysinst/msg.mi.es:1.35
--- src/distrib/utils/sysinst/msg.mi.es:1.34	Mon Apr  4 08:30:13 2011
+++ src/distrib/utils/sysinst/msg.mi.es	Sun Apr 17 12:33:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.34 2011/04/04 08:30:13 mbalmer Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.35 2011/04/17 12:33:42 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -899,6 +899,7 @@
 message Re_install_sets_or_install_additional_sets {Reinstalar conjuntos o instalar conjuntos adicionales}
 message Reboot_the_computer {Reiniciar la computadora}
 message Utility_menu {Menú de utilidades}
+message exit_utility_menu {Exit}
 message NetBSD_VERSION_Utilities {Utilidades de NetBSD-@@VERSION@@}
 message Run_bin_sh {Ejecutar /bin/sh}
 message Set_timezone {Establecer la zona horaria}

Index: src/distrib/utils/sysinst/msg.mi.fr
diff -u src/distrib/utils/sysinst/msg.mi.fr:1.114 src/distrib/utils/sysinst/msg.mi.fr:1.115
--- src/distrib/utils/sysinst/msg.mi.fr:1.114	Mon Apr  4 08:30:13 2011
+++ src/distrib/utils/sysinst/msg.mi.fr	Sun Apr 17 12:33:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.114 2011/04/04 08:30:13 mbalmer Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.115 2011/04/17 12:33:42 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -966,6 +966,7 @@
 message 

CVS commit: src/tools

2011-04-17 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Sun Apr 17 12:52:26 UTC 2011

Modified Files:
src/tools/libctf: Makefile
src/tools/libdwarf: Makefile
src/tools/libelf: Makefile

Log Message:
Set HOSTLIB before including bsd.own.mk to get the destination
directory checks to work properly.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tools/libctf/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tools/libdwarf/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tools/libelf/Makefile

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

Modified files:

Index: src/tools/libctf/Makefile
diff -u src/tools/libctf/Makefile:1.2 src/tools/libctf/Makefile:1.3
--- src/tools/libctf/Makefile:1.2	Sat Jun 19 23:11:10 2010
+++ src/tools/libctf/Makefile	Sun Apr 17 12:52:26 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.2 2010/06/19 23:11:10 riz Exp $
-
-.include bsd.own.mk
+#	$NetBSD: Makefile,v 1.3 2011/04/17 12:52:26 tron Exp $
 
 HOSTLIB=	ctf
 
+.include bsd.own.mk
+
 SRCS=		ctf_create.c \
 		ctf_decl.c \
 		ctf_error.c \

Index: src/tools/libdwarf/Makefile
diff -u src/tools/libdwarf/Makefile:1.2 src/tools/libdwarf/Makefile:1.3
--- src/tools/libdwarf/Makefile:1.2	Sat Jun 19 23:11:10 2010
+++ src/tools/libdwarf/Makefile	Sun Apr 17 12:52:26 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.2 2010/06/19 23:11:10 riz Exp $
-
-.include bsd.own.mk
+#	$NetBSD: Makefile,v 1.3 2011/04/17 12:52:26 tron Exp $
 
 HOSTLIB=dwarf
 
+.include bsd.own.mk
+
 SRCS=	dwarf_abbrev.c		\
 	dwarf_attr.c		\
 	dwarf_attrval.c		\

Index: src/tools/libelf/Makefile
diff -u src/tools/libelf/Makefile:1.4 src/tools/libelf/Makefile:1.5
--- src/tools/libelf/Makefile:1.4	Sat Jun 19 23:11:10 2010
+++ src/tools/libelf/Makefile	Sun Apr 17 12:52:26 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.4 2010/06/19 23:11:10 riz Exp $
-
-.include bsd.own.mk
+#	$NetBSD: Makefile,v 1.5 2011/04/17 12:52:26 tron Exp $
 
 HOSTLIB=	elf
 
+.include bsd.own.mk
+
 SRCS=		elf_begin.c		\
 		elf_cntl.c		\
 		elf_end.c elf_errmsg.c elf_errno.c			\



CVS commit: src/share/mk

2011-04-17 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Sun Apr 17 12:54:23 UTC 2011

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Don't use --sysroot=/ for host builds as nbhost-mkdep doesn't
understand that option. This should unbreak tool builds.


To generate a diff of this commit:
cvs rdiff -u -r1.659 -r1.660 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.659 src/share/mk/bsd.own.mk:1.660
--- src/share/mk/bsd.own.mk:1.659	Sun Apr 17 00:05:36 2011
+++ src/share/mk/bsd.own.mk	Sun Apr 17 12:54:22 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.659 2011/04/17 00:05:36 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.660 2011/04/17 12:54:22 tron Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -210,9 +210,6 @@
 .if !defined(HOSTPROG)  !defined(HOSTLIB)  defined(DESTDIR)
 CPPFLAGS+=	--sysroot=${DESTDIR}
 LDFLAGS+=	--sysroot=${DESTDIR}
-.else
-CPPFLAGS+=	--sysroot=/
-LDFLAGS+=	--sysroot=/
 .endif
 .endif	# EXTERNAL_TOOLCHAIN		# }
 



CVS commit: src/distrib/sets/lists/base

2011-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 17 13:04:50 UTC 2011

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
Get rid of /var/chroot/tcpdump/etc


To generate a diff of this commit:
cvs rdiff -u -r1.932 -r1.933 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.932 src/distrib/sets/lists/base/mi:1.933
--- src/distrib/sets/lists/base/mi:1.932	Sat Apr 16 22:00:34 2011
+++ src/distrib/sets/lists/base/mi	Sun Apr 17 13:04:50 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.932 2011/04/16 22:00:34 christos Exp $
+# $NetBSD: mi,v 1.933 2011/04/17 13:04:50 martin Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -4843,8 +4843,8 @@
 ./var/chroot/spamdbase-obsolete		obsolete
 ./var/chroot/sshdbase-sys-root
 ./var/chroot/tcpdumpbase-sys-root
-./var/chroot/tcpdump/etc			base-sys-root
-./var/chroot/tcpdump/etc/protocols		base-sys-root
+./var/chroot/tcpdump/etc			base-obsolete		obsolete
+./var/chroot/tcpdump/etc/protocols		base-obsolete		obsolete
 ./var/chroot/tftp-proxybase-sys-root
 ./var/crash	base-sys-root
 ./var/cron	base-cron-root



CVS commit: src/etc

2011-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 17 13:07:18 UTC 2011

Modified Files:
src/etc: Makefile
src/etc/mtree: NetBSD.dist.base special

Log Message:
Get rid of var/chroot/tcpdump/etc


To generate a diff of this commit:
cvs rdiff -u -r1.389 -r1.390 src/etc/Makefile
cvs rdiff -u -r1.84 -r1.85 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.136 -r1.137 src/etc/mtree/special

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

Modified files:

Index: src/etc/Makefile
diff -u src/etc/Makefile:1.389 src/etc/Makefile:1.390
--- src/etc/Makefile:1.389	Mon Apr 11 21:49:13 2011
+++ src/etc/Makefile	Sun Apr 17 13:07:18 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.389 2011/04/11 21:49:13 martin Exp $
+#	$NetBSD: Makefile,v 1.390 2011/04/17 13:07:18 martin Exp $
 #	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -301,9 +301,6 @@
 	${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
 	${.CURDIR}/etc.${MACHINE}/boot.cfg ${DESTDIR}/
 .endif
-	${_MKMSG_INSTALL} ${DESTDIR}/var/chroot/tcpdump/etc/protocols
-	${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
-	${NETBSDSRCDIR}/etc/protocols ${DESTDIR}/var/chroot/tcpdump/etc
 	${_MKMSG_INSTALL} ${DESTDIR}/dev/MAKEDEV
 	${ETC_INSTALL_OBJ_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
 	MAKEDEV ${DESTDIR}/dev

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.84 src/etc/mtree/NetBSD.dist.base:1.85
--- src/etc/mtree/NetBSD.dist.base:1.84	Sat Apr 16 21:58:31 2011
+++ src/etc/mtree/NetBSD.dist.base	Sun Apr 17 13:07:18 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.84 2011/04/16 21:58:31 christos Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.85 2011/04/17 13:07:18 martin Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1107,7 +1107,6 @@
 ./var/chroot/pflogd		mode=0755
 ./var/chroot/sshd		mode=0755
 ./var/chroot/tcpdump		mode=0755
-./var/chroot/tcpdump/etc	mode=0755
 ./var/chroot/tftp-proxy		mode=0755
 ./var/crash			mode=0770
 ./var/cron

Index: src/etc/mtree/special
diff -u src/etc/mtree/special:1.136 src/etc/mtree/special:1.137
--- src/etc/mtree/special:1.136	Mon Apr 11 20:03:45 2011
+++ src/etc/mtree/special	Sun Apr 17 13:07:18 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: special,v 1.136 2011/04/11 20:03:45 martin Exp $
+#	$NetBSD: special,v 1.137 2011/04/17 13:07:18 martin Exp $
 #	@(#)special	8.2 (Berkeley) 1/23/94
 #
 # This file may be overwritten on upgrades.
@@ -395,7 +395,6 @@
 ./var/chroot/pflogd		type=dir  mode=0755
 ./var/chroot/sshd		type=dir  mode=0755
 ./var/chroot/tcpdump		type=dir  mode=0755
-./var/chroot/tcpdump/etc	type=dir  mode=0755
 ./var/chroot/tftp-proxy		type=dir  mode=0755
 ./var/cron			type=dir  mode=0755
 ./var/cron/tabs			type=dir  mode=0700



CVS commit: src/sys/arch/sandpoint/stand/altboot

2011-04-17 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Apr 17 13:09:30 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: brdsetup.c

Log Message:
DSM-G600 has a 33.000 MHz oscillator on board.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sandpoint/stand/altboot/brdsetup.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/arch/sandpoint/stand/altboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.14 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.15
--- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.14	Wed Apr 13 18:32:21 2011
+++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c	Sun Apr 17 13:09:30 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.14 2011/04/13 18:32:21 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.15 2011/04/17 13:09:30 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -106,7 +106,7 @@
 	dlink,
 	D-Link DSM-G600,
 	BRD_DLINKDSM,
-	0,
+	3300,
 	eumb, 0x4500, 9600,
 	NULL, dlinkbrdfix, NULL, NULL },
 {



CVS commit: src/usr.sbin/postinstall

2011-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 17 13:16:59 UTC 2011

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Invert the chroot/tcpdump/etc test and make it remove the (not needed
anymore) directory.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/usr.sbin/postinstall/postinstall

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.116 src/usr.sbin/postinstall/postinstall:1.117
--- src/usr.sbin/postinstall/postinstall:1.116	Mon Apr 11 20:29:50 2011
+++ src/usr.sbin/postinstall/postinstall	Sun Apr 17 13:16:59 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.116 2011/04/11 20:29:50 martin Exp $
+# $NetBSD: postinstall,v 1.117 2011/04/17 13:16:59 martin Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1467,17 +1467,17 @@
 #
 #	tcpdumpchroot
 #
-additem tcpdumpchroot make sure /var/chroot/tcpdump/etc is populated
+additem tcpdumpchroot remove /var/chroot/tcpdump/etc/protocols
 do_tcpdumpchroot()
 {
 	[ -n $1 ] || err 3 USAGE: do_tcpdumpchroot  fix|check
 
 	failed=0;
-	if [ ! -r ${DEST_DIR}/var/chroot/tcpdump/etc/protocols ]; then
+	if [ -r ${DEST_DIR}/var/chroot/tcpdump/etc/protocols ]; then
 		if [ $1 = fix ]; then
-			mkdir -p ${DEST_DIR}/var/chroot/tcpdump/etc
-			cp ${SRC_DIR}/etc/protocols \
-${DEST_DIR}/var/chroot/tcpdump/etc
+			rm ${DEST_DIR}/var/chroot/tcpdump/etc/protocols
+			failed=$(( ${failed} + $? ))
+			rmdir  ${DEST_DIR}/var/chroot/tcpdump/etc
 			failed=$(( ${failed} + $? ))
 		else
 			failed=1



CVS commit: src/sys/arch/sandpoint/sandpoint

2011-04-17 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Apr 17 14:05:59 UTC 2011

Modified Files:
src/sys/arch/sandpoint/sandpoint: satmgr.c

Log Message:
DSM-G600: Turn off all LEDs when shutting down, to indicate the device
can be switched off.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sandpoint/sandpoint/satmgr.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/arch/sandpoint/sandpoint/satmgr.c
diff -u src/sys/arch/sandpoint/sandpoint/satmgr.c:1.9 src/sys/arch/sandpoint/sandpoint/satmgr.c:1.10
--- src/sys/arch/sandpoint/sandpoint/satmgr.c:1.9	Sun Apr 10 16:30:32 2011
+++ src/sys/arch/sandpoint/sandpoint/satmgr.c	Sun Apr 17 14:05:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: satmgr.c,v 1.9 2011/04/10 16:30:32 phx Exp $ */
+/* $NetBSD: satmgr.c,v 1.10 2011/04/17 14:05:59 phx Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -120,6 +120,7 @@
 static void kpwroff(struct satmgr_softc *);
 static void spwroff(struct satmgr_softc *);
 static void qpwroff(struct satmgr_softc *);
+static void dpwroff(struct satmgr_softc *);
 static void kbutton(struct satmgr_softc *, int);
 static void sbutton(struct satmgr_softc *, int);
 static void qbutton(struct satmgr_softc *, int);
@@ -136,7 +137,7 @@
 };
 
 static struct satops satmodel[] = {
-{ dlink,NULL, NULL, NULL, dbutton },
+{ dlink,NULL, NULL, dpwroff, dbutton },
 { kurobox,  NULL, kreboot, kpwroff, kbutton },
 { qnap, qinit, qreboot, qpwroff, qbutton },
 { synology, sinit, sreboot, spwroff, sbutton }
@@ -729,6 +730,17 @@
 }
 
 static void
+dpwroff(struct satmgr_softc *sc)
+{
+
+	/*
+	 * The DSM-G600 has no hardware-shutdown, but we turn all LEDs off,
+	 * to indicated that we powered down.
+	 */
+	send_sat(sc, TSC\nTSC\n);
+}
+
+static void
 dbutton(struct satmgr_softc *sc, int ch)
 {
 



CVS commit: src/sys/dev/i2c

2011-04-17 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Apr 17 14:58:27 UTC 2011

Modified Files:
src/sys/dev/i2c: m41st84.c

Log Message:
Do not print M41ST84 Real-time Clock/NVRAM, but M41T8x Real-time Clock
when STRTC_NO_USERRAM is defined. This driver should work for all M41T8x
compatible chips (tested on my DSM-G600 with M41T80).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/m41st84.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/dev/i2c/m41st84.c
diff -u src/sys/dev/i2c/m41st84.c:1.16 src/sys/dev/i2c/m41st84.c:1.17
--- src/sys/dev/i2c/m41st84.c:1.16	Sun Oct 10 05:17:44 2010
+++ src/sys/dev/i2c/m41st84.c	Sun Apr 17 14:58:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: m41st84.c,v 1.16 2010/10/10 05:17:44 kiyohara Exp $	*/
+/*	$NetBSD: m41st84.c,v 1.17 2011/04/17 14:58:26 phx Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: m41st84.c,v 1.16 2010/10/10 05:17:44 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: m41st84.c,v 1.17 2011/04/17 14:58:26 phx Exp $);
 
 #include opt_strtc.h
 
@@ -105,9 +105,13 @@
 	struct strtc_softc *sc = device_private(self);
 	struct i2c_attach_args *ia = arg;
 
+#ifndef STRTC_NO_USERRAM
 	aprint_naive(: Real-time Clock/NVRAM\n);
 	aprint_normal(: M41ST84 Real-time Clock/NVRAM\n);
-
+#else
+	aprint_naive(: Real-time Clock\n);
+	aprint_normal(: M41T8x Real-time Clock\n);
+#endif
 	sc-sc_tag = ia-ia_tag;
 	sc-sc_address = ia-ia_addr;
 	sc-sc_dev = self;



CVS commit: src/share/mk

2011-04-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 17 15:03:37 UTC 2011

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Revert previous, breaks builds completely (cd /usr/src/bin/test  make clean 
make)


To generate a diff of this commit:
cvs rdiff -u -r1.660 -r1.661 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.660 src/share/mk/bsd.own.mk:1.661
--- src/share/mk/bsd.own.mk:1.660	Sun Apr 17 08:54:22 2011
+++ src/share/mk/bsd.own.mk	Sun Apr 17 11:03:37 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.660 2011/04/17 12:54:22 tron Exp $
+#	$NetBSD: bsd.own.mk,v 1.661 2011/04/17 15:03:37 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -210,6 +210,9 @@
 .if !defined(HOSTPROG)  !defined(HOSTLIB)  defined(DESTDIR)
 CPPFLAGS+=	--sysroot=${DESTDIR}
 LDFLAGS+=	--sysroot=${DESTDIR}
+.else
+CPPFLAGS+=	--sysroot=/
+LDFLAGS+=	--sysroot=/
 .endif
 .endif	# EXTERNAL_TOOLCHAIN		# }
 



CVS commit: src/sys/dev/i2c

2011-04-17 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Apr 17 15:15:00 UTC 2011

Modified Files:
src/sys/dev/i2c: motoi2c.c motoi2cvar.h

Log Message:
Suppressing the ACK after the last byte read must not depend on
I2C_OP_STOP_P(), but all read-transfers have to be finished that way.
Otherwise a chip might hang after a read-operation without stop.

Removed sc_start from the softc structure, which is unused.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/motoi2c.c \
src/sys/dev/i2c/motoi2cvar.h

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

Modified files:

Index: src/sys/dev/i2c/motoi2c.c
diff -u src/sys/dev/i2c/motoi2c.c:1.3 src/sys/dev/i2c/motoi2c.c:1.4
--- src/sys/dev/i2c/motoi2c.c:1.3	Wed Jan 12 18:06:26 2011
+++ src/sys/dev/i2c/motoi2c.c	Sun Apr 17 15:14:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: motoi2c.c,v 1.3 2011/01/12 18:06:26 phx Exp $ */
+/* $NetBSD: motoi2c.c,v 1.4 2011/04/17 15:14:59 phx Exp $ */
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: motoi2c.c,v 1.3 2011/01/12 18:06:26 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: motoi2c.c,v 1.4 2011/04/17 15:14:59 phx Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -98,7 +98,6 @@
 
 	sc-sc_i2c = motoi2c;
 	sc-sc_i2c.ic_cookie = sc;
-	sc-sc_start = false;
 	if (sc-sc_iord == NULL)
 		sc-sc_iord = motoi2c_iord1;
 	if (sc-sc_iowr == NULL)
@@ -131,7 +130,6 @@
 {
 	struct motoi2c_softc * const sc = v;
 
-	sc-sc_start = false;
 	I2C_WRITE(I2CCR, 0);		/* reset before changing anything */
 	mutex_exit(sc-sc_buslock);
 }
@@ -289,9 +287,8 @@
 	if (I2C_OP_READ_P(op)) {
 		uint8_t *dataptr = databuf;
 		cr = ~CR_MTX;		/* clear transmit flags */
-		if (datalen = 1  I2C_OP_STOP_P(op)) {
+		if (datalen = 1)
 			cr |= CR_TXAK;
-		}
 		I2C_WRITE(I2CCR, cr);
 		DELAY(10);
 		(void)I2C_READ(I2CDR);		/* dummy read */
@@ -309,19 +306,20 @@
 __func__, i, error));
 goto out;
 			}
-			if (I2C_OP_STOP_P(op)) {
-if (i == datalen - 2) {
-	cr |= CR_TXAK;
-	I2C_WRITE(I2CCR, cr);
-} else if (i == datalen - 1) {
-	cr = CR_MEN;
-	I2C_WRITE(I2CCR, cr);
-	sc-sc_start = false;
-}
+			if (i == datalen - 2) {
+cr |= CR_TXAK;
+I2C_WRITE(I2CCR, cr);
+			} else if (i == datalen - 1  I2C_OP_STOP_P(op)) {
+cr = CR_MEN;
+I2C_WRITE(I2CCR, cr);
 			}
 			*dataptr++ = I2C_READ(I2CDR);
 		}
 		if (datalen == 0) {
+			if (I2C_OP_STOP_P(op)) {
+cr = CR_MEN;
+I2C_WRITE(I2CCR, cr);
+			}
 			(void)I2C_READ(I2CDR);	/* dummy read */
 			error = motoi2c_busy_wait(sc, cr);
 			if (error) {
Index: src/sys/dev/i2c/motoi2cvar.h
diff -u src/sys/dev/i2c/motoi2cvar.h:1.3 src/sys/dev/i2c/motoi2cvar.h:1.4
--- src/sys/dev/i2c/motoi2cvar.h:1.3	Wed Jan 12 18:05:18 2011
+++ src/sys/dev/i2c/motoi2cvar.h	Sun Apr 17 15:14:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: motoi2cvar.h,v 1.3 2011/01/12 18:05:18 phx Exp $ */
+/* $NetBSD: motoi2cvar.h,v 1.4 2011/04/17 15:14:59 phx Exp $ */
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -49,7 +49,6 @@
 	bus_space_handle_t	sc_ioh;
 	struct i2c_controller	sc_i2c;
 	kmutex_t		sc_buslock;
-	bool			sc_start;
 	motoi2c_iord_t		sc_iord;
 	motoi2c_iowr_t		sc_iowr;
 };



CVS commit: src/sys/kern

2011-04-17 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun Apr 17 20:37:43 UTC 2011

Modified Files:
src/sys/kern: uipc_sem.c

Log Message:
ksem_free: remove wrong assert.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/kern/uipc_sem.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/kern/uipc_sem.c
diff -u src/sys/kern/uipc_sem.c:1.34 src/sys/kern/uipc_sem.c:1.35
--- src/sys/kern/uipc_sem.c:1.34	Sat Apr 16 20:39:18 2011
+++ src/sys/kern/uipc_sem.c	Sun Apr 17 20:37:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_sem.c,v 1.34 2011/04/16 20:39:18 rmind Exp $	*/
+/*	$NetBSD: uipc_sem.c,v 1.35 2011/04/17 20:37:43 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_sem.c,v 1.34 2011/04/16 20:39:18 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_sem.c,v 1.35 2011/04/17 20:37:43 rmind Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -312,7 +312,6 @@
 ksem_free(ksem_t *ks)
 {
 
-	KASSERT(ks-ks_ref == 0);
 	KASSERT(!cv_has_waiters(ks-ks_cv));
 
 	if (ks-ks_name) {



CVS commit: src/usr.bin/mkdep

2011-04-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 17 22:35:22 UTC 2011

Modified Files:
src/usr.bin/mkdep: mkdep.c

Log Message:
Recognize --sysroot but don't document it or do anything about it for now.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/mkdep/mkdep.c

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

Modified files:

Index: src/usr.bin/mkdep/mkdep.c
diff -u src/usr.bin/mkdep/mkdep.c:1.35 src/usr.bin/mkdep/mkdep.c:1.36
--- src/usr.bin/mkdep/mkdep.c:1.35	Wed May 26 14:07:34 2010
+++ src/usr.bin/mkdep/mkdep.c	Sun Apr 17 18:35:22 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdep.c,v 1.35 2010/05/26 18:07:34 christos Exp $ */
+/* $NetBSD: mkdep.c,v 1.36 2011/04/17 22:35:22 christos Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT(@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\
  All rights reserved.);
-__RCSID($NetBSD: mkdep.c,v 1.35 2010/05/26 18:07:34 christos Exp $);
+__RCSID($NetBSD: mkdep.c,v 1.36 2011/04/17 22:35:22 christos Exp $);
 #endif /* not lint */
 
 #include sys/mman.h
@@ -46,6 +46,7 @@
 #include ctype.h
 #include err.h
 #include fcntl.h
+#include getopt.h
 #include locale.h
 #include paths.h
 #include stdio.h
@@ -183,6 +184,11 @@
 	return fbuf;
 }
 
+static struct option longopt[] = {
+	{ sysroot, 1, NULL, 'R' },
+	{ NULL, 0, NULL, '\0' },
+};
+
 int
 main(int argc, char **argv)
 {
@@ -214,7 +220,7 @@
 	opterr = 0;	/* stop getopt() bleating about errors. */
 	for (;;) {
 		ok_ind = optind;
-		ch = getopt(argc, argv, aDdf:opqs:);
+		ch = getopt_long(argc, argv, aDdf:opqRs:, longopt, NULL);
 		switch (ch) {
 		case -1:
 			ok_ind = optind;
@@ -242,6 +248,9 @@
 		case 'q':	/* Quiet */
 			qflag = 1;
 			continue;
+		case 'R':
+			/* sysroot = optarg */
+			continue;
 		case 's':	/* Suffix list */
 			suffixes = optarg;
 			continue;



CVS commit: src/lib/libc/db

2011-04-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 17 23:12:38 UTC 2011

Modified Files:
src/lib/libc/db/btree: bt_open.c
src/lib/libc/db/hash: hash_page.c

Log Message:
Correct check for snprintf() overflow via Maksymilian Arciemowicz from FreeBSD.
(the bt one was ok, but set errno and make it the same for consistency).
[to be pulled up]


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/db/btree/bt_open.c
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/db/hash/hash_page.c

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

Modified files:

Index: src/lib/libc/db/btree/bt_open.c
diff -u src/lib/libc/db/btree/bt_open.c:1.24 src/lib/libc/db/btree/bt_open.c:1.25
--- src/lib/libc/db/btree/bt_open.c:1.24	Thu Sep 11 08:58:00 2008
+++ src/lib/libc/db/btree/bt_open.c	Sun Apr 17 19:12:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_open.c,v 1.24 2008/09/11 12:58:00 joerg Exp $	*/
+/*	$NetBSD: bt_open.c,v 1.25 2011/04/17 23:12:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: bt_open.c,v 1.24 2008/09/11 12:58:00 joerg Exp $);
+__RCSID($NetBSD: bt_open.c,v 1.25 2011/04/17 23:12:38 christos Exp $);
 
 /*
  * Implementation of btree access method for 4.4BSD.
@@ -391,7 +391,7 @@
 tmp(void)
 {
 	sigset_t set, oset;
-	size_t len;
+	int len;
 	int fd;
 	char *envtmp;
 	char path[PATH_MAX];
@@ -403,8 +403,10 @@
 
 	len = snprintf(path,
 	sizeof(path), %s/bt.XX, envtmp ? envtmp : _PATH_TMP);
-	if (len = sizeof(path))
+	if (len  0 || (size_t)len = sizeof(path)) {
+		errno = ENAMETOOLONG;
 		return -1;
+	}
 	
 	(void)sigfillset(set);
 	(void)sigprocmask(SIG_BLOCK, set, oset);

Index: src/lib/libc/db/hash/hash_page.c
diff -u src/lib/libc/db/hash/hash_page.c:1.23 src/lib/libc/db/hash/hash_page.c:1.24
--- src/lib/libc/db/hash/hash_page.c:1.23	Thu Sep 11 08:58:00 2008
+++ src/lib/libc/db/hash/hash_page.c	Sun Apr 17 19:12:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash_page.c,v 1.23 2008/09/11 12:58:00 joerg Exp $	*/
+/*	$NetBSD: hash_page.c,v 1.24 2011/04/17 23:12:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hash_page.c,v 1.23 2008/09/11 12:58:00 joerg Exp $);
+__RCSID($NetBSD: hash_page.c,v 1.24 2011/04/17 23:12:38 christos Exp $);
 
 /*
  * PACKAGE:  hashing
@@ -869,15 +869,19 @@
 	sigset_t set, oset;
 	char *envtmp;
 	char namestr[PATH_MAX];
+	int len;
 
 	if (issetugid())
 		envtmp = NULL;
 	else
 		envtmp = getenv(TMPDIR);
 
-	if (-1 == snprintf(namestr, sizeof(namestr), %s/_hashXX,
-	envtmp ? envtmp : _PATH_TMP))
+	len = snprintf(namestr, sizeof(namestr), %s/_hashXX,
+	envtmp ? envtmp : _PATH_TMP);
+	if (len  0 || (size_t)len = sizeof(namestr)) {
+		errno = ENAMETOOLONG;
 		return -1;
+	}
 
 	/* Block signals; make sure file goes away at process exit. */
 	(void)sigfillset(set);



CVS commit: src/sys/arch/xen/xen

2011-04-17 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Apr 17 23:54:05 UTC 2011

Modified Files:
src/sys/arch/xen/xen: hypervisor.c

Log Message:
Remove remnants from the past when Xen 2 was still alive.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/xen/xen/hypervisor.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/arch/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.53 src/sys/arch/xen/xen/hypervisor.c:1.54
--- src/sys/arch/xen/xen/hypervisor.c:1.53	Sat Aug  7 21:58:34 2010
+++ src/sys/arch/xen/xen/hypervisor.c	Sun Apr 17 23:54:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.53 2010/08/07 21:58:34 cegger Exp $ */
+/* $NetBSD: hypervisor.c,v 1.54 2011/04/17 23:54:05 jym Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hypervisor.c,v 1.53 2010/08/07 21:58:34 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: hypervisor.c,v 1.54 2011/04/17 23:54:05 jym Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -225,16 +225,6 @@
 	hac.hac_xencons.xa_device = xencons;
 	config_found_ia(self, xendevbus, hac.hac_xencons, hypervisor_print);
 #endif
-#if NXENNET_HYPERVISOR  0
-	memset(hac, 0, sizeof(hac));
-	hac.hac_xennet.xa_device = xennet;
-	xennet_scan(self, hac.hac_xennet, hypervisor_print);
-#endif
-#if NXBD_HYPERVISOR  0
-	memset(hac, 0, sizeof(hac));
-	hac.hac_xbd.xa_device = xbd;
-	xbd_scan(self, hac.hac_xbd, hypervisor_print);
-#endif
 #if NNPX  0
 	memset(hac, 0, sizeof(hac));
 	hac.hac_xennpx.xa_device = npx;



CVS commit: src/sys

2011-04-17 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Apr 18 00:26:12 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc: machdep.c trap.c vm_machdep.c
src/sys/kern: kern_proc.c
src/sys/sys: proc.h

Log Message:
Replace malloc with kmem, and remove M_SUBPROC.


To generate a diff of this commit:
cvs rdiff -u -r1.307 -r1.308 src/sys/arch/sparc/sparc/machdep.c
cvs rdiff -u -r1.186 -r1.187 src/sys/arch/sparc/sparc/trap.c
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/sparc/sparc/vm_machdep.c
cvs rdiff -u -r1.174 -r1.175 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.303 -r1.304 src/sys/sys/proc.h

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

Modified files:

Index: src/sys/arch/sparc/sparc/machdep.c
diff -u src/sys/arch/sparc/sparc/machdep.c:1.307 src/sys/arch/sparc/sparc/machdep.c:1.308
--- src/sys/arch/sparc/sparc/machdep.c:1.307	Fri Mar  4 22:25:28 2011
+++ src/sys/arch/sparc/sparc/machdep.c	Mon Apr 18 00:26:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.307 2011/03/04 22:25:28 joerg Exp $ */
+/*	$NetBSD: machdep.c,v 1.308 2011/04/18 00:26:11 rmind Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.307 2011/03/04 22:25:28 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.308 2011/04/18 00:26:11 rmind Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_compat_sunos.h
@@ -383,7 +383,7 @@
 		}
 		l-l_md.md_fpu = NULL;
 		FPU_UNLOCK(s);
-		free((void *)fs, M_SUBPROC);
+		kmem_free(fs, sizeof(struct fpstate));
 		l-l_md.md_fpstate = NULL;
 	}
 	memset((void *)tf, 0, sizeof *tf);

Index: src/sys/arch/sparc/sparc/trap.c
diff -u src/sys/arch/sparc/sparc/trap.c:1.186 src/sys/arch/sparc/sparc/trap.c:1.187
--- src/sys/arch/sparc/sparc/trap.c:1.186	Fri Jan 14 02:06:31 2011
+++ src/sys/arch/sparc/sparc/trap.c	Mon Apr 18 00:26:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.186 2011/01/14 02:06:31 rmind Exp $ */
+/*	$NetBSD: trap.c,v 1.187 2011/04/18 00:26:12 rmind Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.186 2011/01/14 02:06:31 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.187 2011/04/18 00:26:12 rmind Exp $);
 
 #include opt_ddb.h
 #include opt_compat_svr4.h
@@ -61,7 +61,6 @@
 #include sys/systm.h
 #include sys/proc.h
 #include sys/kernel.h
-#include sys/malloc.h
 #include sys/kmem.h
 #include sys/resource.h
 #include sys/signal.h
@@ -419,7 +418,7 @@
 #endif
 
 		if (fs == NULL) {
-			fs = malloc(sizeof *fs, M_SUBPROC, M_WAITOK);
+			fs = kmem_alloc(sizeof(struct fpstate), KM_SLEEP);
 			*fs = initfpstate;
 			l-l_md.md_fpstate = fs;
 		}

Index: src/sys/arch/sparc/sparc/vm_machdep.c
diff -u src/sys/arch/sparc/sparc/vm_machdep.c:1.105 src/sys/arch/sparc/sparc/vm_machdep.c:1.106
--- src/sys/arch/sparc/sparc/vm_machdep.c:1.105	Thu Feb 24 04:28:48 2011
+++ src/sys/arch/sparc/sparc/vm_machdep.c	Mon Apr 18 00:26:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.105 2011/02/24 04:28:48 joerg Exp $ */
+/*	$NetBSD: vm_machdep.c,v 1.106 2011/04/18 00:26:12 rmind Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.105 2011/02/24 04:28:48 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.106 2011/04/18 00:26:12 rmind Exp $);
 
 #include opt_multiprocessor.h
 
@@ -57,11 +57,10 @@
 #include sys/systm.h
 #include sys/proc.h
 #include sys/core.h
-#include sys/malloc.h
+#include sys/kmem.h
 #include sys/buf.h
 #include sys/exec.h
 #include sys/vnode.h
-#include sys/simplelock.h
 #include sys/cpu.h
 
 #include uvm/uvm_extern.h
@@ -220,8 +219,8 @@
 		struct cpu_info *cpi;
 		int s;
 
-		l2-l_md.md_fpstate = malloc(sizeof(struct fpstate),
-		M_SUBPROC, M_WAITOK);
+		l2-l_md.md_fpstate =
+		kmem_alloc(sizeof(struct fpstate), KM_SLEEP);
 
 		FPU_LOCK(s);
 		if ((cpi = l1-l_md.md_fpu) != NULL) {
@@ -325,7 +324,7 @@
 	struct fpstate *fs;
 
 	if ((fs = l-l_md.md_fpstate) != NULL)
-		free((void *)fs, M_SUBPROC);
+		kmem_free(fs, sizeof(struct fpstate));
 }
 
 void

Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.174 src/sys/kern/kern_proc.c:1.175
--- src/sys/kern/kern_proc.c:1.174	Tue Apr  5 09:02:23 2011
+++ src/sys/kern/kern_proc.c	Mon Apr 18 00:26:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_proc.c,v 1.174 2011/04/05 09:02:23 rmind Exp $	*/
+/*	$NetBSD: kern_proc.c,v 1.175 2011/04/18 00:26:11 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_proc.c,v 1.174 2011/04/05 09:02:23 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_proc.c,v 1.175 2011/04/18 00:26:11 rmind Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_kstack.h
@@ -205,7 +205,6 @@
 int cmask = CMASK;
 
 MALLOC_DEFINE(M_EMULDATA, emuldata, Per-process 

CVS commit: src/sys/nfs

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:38:33 UTC 2011

Modified Files:
src/sys/nfs: nfs_serv.c

Log Message:
Back in -r1.60 of nfs_serv.c (a long time ago) VOP_MKNOD was changed
so nfsd no longer needed to do a lookup() call immediately afterwards
to retrieve the newly created object.

Since that change there has been no way for ISSYMLINK to be set upon
return from VOP_MKNOD (or before the call to VOP_MKNOD either) so
remove the test for it and associated block of dead code.

(I do not understand how this code was reachable before then either.
The logic in question is only reached if no object by that name
existed, and there's no reasonable way that a successful call to
VOP_MKNOD should ever create a symlink. The code appears to come from
4.4lite; maybe they had locking bugs?)


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/nfs/nfs_serv.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/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.158 src/sys/nfs/nfs_serv.c:1.159
--- src/sys/nfs/nfs_serv.c:1.158	Mon Apr 11 01:33:05 2011
+++ src/sys/nfs/nfs_serv.c	Mon Apr 18 00:38:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.158 2011/04/11 01:33:05 dholland Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.159 2011/04/18 00:38:33 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.158 2011/04/11 01:33:05 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.159 2011/04/18 00:38:33 dholland Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1527,18 +1527,6 @@
 			if (error) {
 nfsm_reply(0);
 			}
-			if (nd.ni_cnd.cn_flags  ISSYMLINK) {
-vput(nd.ni_vp);
-vrele(nd.ni_dvp);
-VOP_ABORTOP(nd.ni_dvp, nd.ni_cnd);
-if (nd.ni_pathbuf != NULL) {
-	pathbuf_destroy(nd.ni_pathbuf);
-	nd.ni_pathbuf = NULL;
-}
-error = EINVAL;
-abort = 0;
-nfsm_reply(0);
-			}
 		} else {
 			VOP_ABORTOP(nd.ni_dvp, nd.ni_cnd);
 			if (nd.ni_pathbuf != NULL) {
@@ -1743,11 +1731,6 @@
 		error = VOP_MKNOD(nd.ni_dvp, nd.ni_vp, nd.ni_cnd, va);
 		if (error)
 			goto out;
-		if (nd.ni_cnd.cn_flags  ISSYMLINK) {
-			vput(nd.ni_vp);
-			VOP_ABORTOP(nd.ni_dvp, nd.ni_cnd);
-			error = EINVAL;
-		}
 	}
 out:
 	vp = nd.ni_vp;



CVS commit: src/sys

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:40:54 UTC 2011

Modified Files:
src/sys/kern: vfs_lookup.c
src/sys/sys: namei.src

Log Message:
ISSYMLINK is now only referenced inside vfs_lookup.c, and not needed
there, so get rid of it.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.22 -r1.23 src/sys/sys/namei.src

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

Modified files:

Index: src/sys/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.175 src/sys/kern/vfs_lookup.c:1.176
--- src/sys/kern/vfs_lookup.c:1.175	Thu Apr 14 15:29:25 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:40:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.175 2011/04/14 15:29:25 yamt Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.176 2011/04/18 00:40:53 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.175 2011/04/14 15:29:25 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.176 2011/04/18 00:40:53 dholland Exp $);
 
 #include opt_magiclinks.h
 
@@ -226,7 +226,7 @@
  *
  * System-call-layer level code that is going to call namei should
  * first create a pathbuf and adjust all the bells and whistles on it
- * as needed by context
+ * as needed by context.
  */
 
 struct pathbuf {
@@ -318,7 +318,7 @@
 
 /*
  * XXX should not exist:
- *   1. whether a pointer is kernel or user should be statically checkable
+ *   1. whether a pointer is kernel or user should be statically checkable.
  *   2. copyin should be handled by the upper part of the syscall layer,
  *  not in here.
  */
@@ -1118,8 +1118,6 @@
 		 * (currently, this may consume more than one)
 		 */
 
-		cnp-cn_flags = ~ISSYMLINK;
-
 dirloop:
 		/*
 		 * If we have a leading string of slashes, remove
@@ -1203,7 +1201,6 @@
 		if (namei_atsymlink(state, foundobj)) {
 			ndp-ni_pathlen += state-slashes;
 			ndp-ni_next -= state-slashes;
-			cnp-cn_flags |= ISSYMLINK;
 			if (neverfollow) {
 error = EINVAL;
 			} else {
@@ -1513,7 +1510,6 @@
 	state-docache = 1;
 	state-rdonly = cnp-cn_flags  RDONLY;
 	ndp-ni_dvp = NULL;
-	cnp-cn_flags = ~ISSYMLINK;
 
 	cnp-cn_consume = 0;
 	cp = NULL;
@@ -1617,7 +1613,6 @@
 	 * Setup: break out flag bits into variables.
 	 */
 	rdonly = cnp-cn_flags  RDONLY;
-	cnp-cn_flags = ~ISSYMLINK;
 
 	/*
 	 * Search a new directory.

Index: src/sys/sys/namei.src
diff -u src/sys/sys/namei.src:1.22 src/sys/sys/namei.src:1.23
--- src/sys/sys/namei.src:1.22	Fri Jan  7 11:25:10 2011
+++ src/sys/sys/namei.src	Mon Apr 18 00:40:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.src,v 1.22 2011/01/07 11:25:10 pooka Exp $	*/
+/*	$NetBSD: namei.src,v 1.23 2011/04/18 00:40:54 dholland Exp $	*/
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -154,14 +154,13 @@
 NAMEIFL	ISDOTDOT	0x0002000	/* current component name is .. */
 NAMEIFL	MAKEENTRY	0x0004000	/* entry is to be added to name cache */
 NAMEIFL	ISLASTCN	0x0008000	/* this is last component of pathname */
-NAMEIFL	ISSYMLINK	0x001	/* symlink needs interpretation */
 NAMEIFL	ISWHITEOUT	0x002	/* found whiteout */
 NAMEIFL	DOWHITEOUT	0x004	/* do whiteouts */
 NAMEIFL	REQUIREDIR	0x008	/* must be a directory */
 NAMEIFL	CREATEDIR	0x020	/* trailing slashes are ok */
 NAMEIFL	INRENAME	0x040	/* operation is a part of ``rename'' */
 NAMEIFL	INRELOOKUP	0x080	/* set while inside relookup() */
-NAMEIFL	PARAMASK	0x0efe300	/* mask of parameter descriptors */
+NAMEIFL	PARAMASK	0x0eee300	/* mask of parameter descriptors */
 
 /*
  * Initialization of an nameidata structure.



CVS commit: src/sys

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:43:57 UTC 2011

Modified Files:
src/sys/rump/include/rump: rump_namei.h
src/sys/sys: namei.h

Log Message:
Regen for ISSYMLINK removal.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/include/rump/rump_namei.h
cvs rdiff -u -r1.75 -r1.76 src/sys/sys/namei.h

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

Modified files:

Index: src/sys/rump/include/rump/rump_namei.h
diff -u src/sys/rump/include/rump/rump_namei.h:1.14 src/sys/rump/include/rump/rump_namei.h:1.15
--- src/sys/rump/include/rump/rump_namei.h:1.14	Fri Jan  7 11:25:43 2011
+++ src/sys/rump/include/rump/rump_namei.h	Mon Apr 18 00:43:56 2011
@@ -1,11 +1,11 @@
-/*	$NetBSD: rump_namei.h,v 1.14 2011/01/07 11:25:43 pooka Exp $	*/
+/*	$NetBSD: rump_namei.h,v 1.15 2011/04/18 00:43:56 dholland Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.22 2011/01/07 11:25:10 pooka Exp 
+ *   from: NetBSD: namei.src,v 1.23 2011/04/18 00:40:54 dholland Exp 
  */
 
 #ifndef _RUMP_RUMP_NAMEI_H_
@@ -30,13 +30,12 @@
 #define RUMP_NAMEI_ISDOTDOT	0x0002000
 #define RUMP_NAMEI_MAKEENTRY	0x0004000
 #define RUMP_NAMEI_ISLASTCN	0x0008000
-#define RUMP_NAMEI_ISSYMLINK	0x001
 #define RUMP_NAMEI_ISWHITEOUT	0x002
 #define RUMP_NAMEI_DOWHITEOUT	0x004
 #define RUMP_NAMEI_REQUIREDIR	0x008
 #define RUMP_NAMEI_CREATEDIR	0x020
 #define RUMP_NAMEI_INRENAME	0x040
 #define RUMP_NAMEI_INRELOOKUP	0x080
-#define RUMP_NAMEI_PARAMASK	0x0efe300
+#define RUMP_NAMEI_PARAMASK	0x0eee300
 
 #endif /* _RUMP_RUMP_NAMEI_H_ */

Index: src/sys/sys/namei.h
diff -u src/sys/sys/namei.h:1.75 src/sys/sys/namei.h:1.76
--- src/sys/sys/namei.h:1.75	Fri Jan  7 11:25:43 2011
+++ src/sys/sys/namei.h	Mon Apr 18 00:43:56 2011
@@ -1,11 +1,11 @@
-/*	$NetBSD: namei.h,v 1.75 2011/01/07 11:25:43 pooka Exp $	*/
+/*	$NetBSD: namei.h,v 1.76 2011/04/18 00:43:56 dholland Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.22 2011/01/07 11:25:10 pooka Exp 
+ *   from: NetBSD: namei.src,v 1.23 2011/04/18 00:40:54 dholland Exp 
  */
 
 /*
@@ -162,14 +162,13 @@
 #define	ISDOTDOT	0x0002000	/* current component name is .. */
 #define	MAKEENTRY	0x0004000	/* entry is to be added to name cache */
 #define	ISLASTCN	0x0008000	/* this is last component of pathname */
-#define	ISSYMLINK	0x001	/* symlink needs interpretation */
 #define	ISWHITEOUT	0x002	/* found whiteout */
 #define	DOWHITEOUT	0x004	/* do whiteouts */
 #define	REQUIREDIR	0x008	/* must be a directory */
 #define	CREATEDIR	0x020	/* trailing slashes are ok */
 #define	INRENAME	0x040	/* operation is a part of ``rename'' */
 #define	INRELOOKUP	0x080	/* set while inside relookup() */
-#define	PARAMASK	0x0efe300	/* mask of parameter descriptors */
+#define	PARAMASK	0x0eee300	/* mask of parameter descriptors */
 
 /*
  * Initialization of an nameidata structure.
@@ -319,13 +318,12 @@
 #define NAMEI_ISDOTDOT	0x0002000
 #define NAMEI_MAKEENTRY	0x0004000
 #define NAMEI_ISLASTCN	0x0008000
-#define NAMEI_ISSYMLINK	0x001
 #define NAMEI_ISWHITEOUT	0x002
 #define NAMEI_DOWHITEOUT	0x004
 #define NAMEI_REQUIREDIR	0x008
 #define NAMEI_CREATEDIR	0x020
 #define NAMEI_INRENAME	0x040
 #define NAMEI_INRELOOKUP	0x080
-#define NAMEI_PARAMASK	0x0efe300
+#define NAMEI_PARAMASK	0x0eee300
 
 #endif /* !_SYS_NAMEI_H_ */



CVS commit: src/sys/kern

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:45:07 UTC 2011

Modified Files:
src/sys/kern: vfs_lookup.c

Log Message:
Goto considered harmful; remove dirloop: in favor of using a loop
continue.

This runs the are we mounted? test on every directory instead of
only sometimes; however, it's not exactly an expensive test (null
pointer check) and the prior logic wasn't exactly sensible -- it
checked at the beginning and after following a symlink but, for some
reason, not after crossing a mount point.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/sys/kern/vfs_lookup.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/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.176 src/sys/kern/vfs_lookup.c:1.177
--- src/sys/kern/vfs_lookup.c:1.176	Mon Apr 18 00:40:53 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:45:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.176 2011/04/18 00:40:53 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.177 2011/04/18 00:45:07 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.176 2011/04/18 00:40:53 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.177 2011/04/18 00:45:07 dholland Exp $);
 
 #include opt_magiclinks.h
 
@@ -1118,7 +1118,6 @@
 		 * (currently, this may consume more than one)
 		 */
 
-dirloop:
 		/*
 		 * If we have a leading string of slashes, remove
 		 * them, and just make sure the current node is a
@@ -1259,7 +1258,7 @@
 			}
 			searchdir = foundobj;
 			foundobj = NULL;
-			goto dirloop;
+			continue;
 		}
 
 terminal:



CVS commit: src/sys/kern

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:45:29 UTC 2011

Modified Files:
src/sys/kern: vfs_lookup.c

Log Message:
Goto still harmful, but use goto alldone in place of a loop break
for now anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/kern/vfs_lookup.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/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.177 src/sys/kern/vfs_lookup.c:1.178
--- src/sys/kern/vfs_lookup.c:1.177	Mon Apr 18 00:45:07 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:45:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.177 2011/04/18 00:45:07 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.178 2011/04/18 00:45:29 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.177 2011/04/18 00:45:07 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.178 2011/04/18 00:45:29 dholland Exp $);
 
 #include opt_magiclinks.h
 
@@ -1184,11 +1184,11 @@
 			/*
 			 * Success with no object returned means we're
 			 * creating something and it isn't already
-			 * there. Break out of the main loop now so
+			 * there. Jump out of the main loop now so
 			 * the code below doesn't have to test for
 			 * foundobj == NULL.
 			 */
-			break;
+			goto alldone;
 		}
 
 		/*
@@ -1351,6 +1351,7 @@
 
 		break;
 	}
+ alldone:
 
 	/*
 	 * Done.



CVS commit: src/sys/kern

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:45:53 UTC 2011

Modified Files:
src/sys/kern: vfs_lookup.c

Log Message:
Move the big chunk of code at terminal: outside the loop; since it
has an unconditional loop break at the end this can be done safely,
now that the other loop break has been patched out.

Add a spurious set of braces to preserve the indent for the moment.


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/kern/vfs_lookup.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/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.178 src/sys/kern/vfs_lookup.c:1.179
--- src/sys/kern/vfs_lookup.c:1.178	Mon Apr 18 00:45:29 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:45:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.178 2011/04/18 00:45:29 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.179 2011/04/18 00:45:53 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.178 2011/04/18 00:45:29 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.179 2011/04/18 00:45:53 dholland Exp $);
 
 #include opt_magiclinks.h
 
@@ -1261,7 +1261,11 @@
 			continue;
 		}
 
+		break;
+	}
+
 terminal:
+	{
 		if (foundobj == ndp-ni_erootdir) {
 			/*
 			 * We are about to return the emulation root.
@@ -1348,9 +1352,8 @@
 			 */
 			VOP_UNLOCK(foundobj);
 		}
-
-		break;
 	}
+
  alldone:
 
 	/*



CVS commit: src/sys/kern

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:46:14 UTC 2011

Modified Files:
src/sys/kern: vfs_lookup.c

Log Message:
Goto considered harmful: goto terminal can now just be break.


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/kern/vfs_lookup.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/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.179 src/sys/kern/vfs_lookup.c:1.180
--- src/sys/kern/vfs_lookup.c:1.179	Mon Apr 18 00:45:53 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:46:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.179 2011/04/18 00:45:53 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.180 2011/04/18 00:46:14 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.179 2011/04/18 00:45:53 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.180 2011/04/18 00:46:14 dholland Exp $);
 
 #include opt_magiclinks.h
 
@@ -1150,7 +1150,7 @@
 			cnp-cn_flags |= ISLASTCN;
 
 			/* bleh */
-			goto terminal;
+			break;
 		}
 
 		error = lookup_parsepath(state);
@@ -1264,7 +1264,6 @@
 		break;
 	}
 
-terminal:
 	{
 		if (foundobj == ndp-ni_erootdir) {
 			/*



CVS commit: src/sys/kern

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:46:39 UTC 2011

Modified Files:
src/sys/kern: vfs_lookup.c

Log Message:
The goto alldone from a couple patches back (inside the loop) can
now be changed to a loop break and another null test and goto outside
the loop. In neither of the other two cases for exiting the loop can
foundobj be null.


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/kern/vfs_lookup.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/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.180 src/sys/kern/vfs_lookup.c:1.181
--- src/sys/kern/vfs_lookup.c:1.180	Mon Apr 18 00:46:14 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:46:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.180 2011/04/18 00:46:14 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.181 2011/04/18 00:46:39 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.180 2011/04/18 00:46:14 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.181 2011/04/18 00:46:39 dholland Exp $);
 
 #include opt_magiclinks.h
 
@@ -1184,11 +1184,11 @@
 			/*
 			 * Success with no object returned means we're
 			 * creating something and it isn't already
-			 * there. Jump out of the main loop now so
+			 * there. Break out of the main loop now so
 			 * the code below doesn't have to test for
 			 * foundobj == NULL.
 			 */
-			goto alldone;
+			break;
 		}
 
 		/*
@@ -1264,6 +1264,10 @@
 		break;
 	}
 
+	if (foundobj == NULL) {
+		goto alldone;
+	}
+
 	{
 		if (foundobj == ndp-ni_erootdir) {
 			/*



CVS commit: src/sys/kern

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:47:04 UTC 2011

Modified Files:
src/sys/kern: vfs_lookup.c

Log Message:
Goto considered harmful: now the goto alldone can be dropped by
reversing the sense of the associated test and using the big block I
moved a couple versions back (and didn't reindent on purpose) as the
body of the if statement.

There are now no gotos in namei_oneroot, only normal loop logic.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/kern/vfs_lookup.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/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.181 src/sys/kern/vfs_lookup.c:1.182
--- src/sys/kern/vfs_lookup.c:1.181	Mon Apr 18 00:46:39 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:47:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.181 2011/04/18 00:46:39 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.182 2011/04/18 00:47:04 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.181 2011/04/18 00:46:39 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.182 2011/04/18 00:47:04 dholland Exp $);
 
 #include opt_magiclinks.h
 
@@ -1264,11 +1264,7 @@
 		break;
 	}
 
-	if (foundobj == NULL) {
-		goto alldone;
-	}
-
-	{
+	if (foundobj != NULL) {
 		if (foundobj == ndp-ni_erootdir) {
 			/*
 			 * We are about to return the emulation root.
@@ -1357,8 +1353,6 @@
 		}
 	}
 
- alldone:
-
 	/*
 	 * Done.
 	 */



CVS commit: src/sys/kern

2011-04-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Apr 18 00:47:24 UTC 2011

Modified Files:
src/sys/kern: vfs_lookup.c

Log Message:
Simplify logic: at the bottom of the loop, instead of checking if we
should continue and if not breaking unconditionally, check if we
should break and if not use the bottom of the loop to continue to the
next iteration.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/kern/vfs_lookup.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/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.182 src/sys/kern/vfs_lookup.c:1.183
--- src/sys/kern/vfs_lookup.c:1.182	Mon Apr 18 00:47:04 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 18 00:47:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.182 2011/04/18 00:47:04 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.183 2011/04/18 00:47:24 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.182 2011/04/18 00:47:04 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.183 2011/04/18 00:47:24 dholland Exp $);
 
 #include opt_magiclinks.h
 
@@ -1229,6 +1229,8 @@
 		}
 
 		/*
+		 * Not a symbolic link.
+		 *
 		 * Check for directory, if the component was
 		 * followed by a series of slashes.
 		 */
@@ -1245,23 +1247,23 @@
 		}
 
 		/*
-		 * Not a symbolic link.  If this was not the
-		 * last component, then continue at the next
-		 * component, else return.
+		 * Stop if we've reached the last component.
 		 */
-		if (!(cnp-cn_flags  ISLASTCN)) {
-			cnp-cn_nameptr = ndp-ni_next;
-			if (searchdir == foundobj) {
-vrele(searchdir);
-			} else {
-vput(searchdir);
-			}
-			searchdir = foundobj;
-			foundobj = NULL;
-			continue;
+		if (cnp-cn_flags  ISLASTCN) {
+			break;
 		}
 
-		break;
+		/*
+		 * Continue with the next component.
+		 */
+		cnp-cn_nameptr = ndp-ni_next;
+		if (searchdir == foundobj) {
+			vrele(searchdir);
+		} else {
+			vput(searchdir);
+		}
+		searchdir = foundobj;
+		foundobj = NULL;
 	}
 
 	if (foundobj != NULL) {



CVS commit: src/sys/arch

2011-04-17 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Mon Apr 18 01:36:25 UTC 2011

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0 XEN3_DOMU
src/sys/arch/i386/conf: XEN3_DOM0 XEN3_DOMU
src/sys/arch/xen/conf: files.xen
src/sys/arch/xen/xen: balloon.c
src/sys/arch/xen/xenbus: xenbus_probe.c

Log Message:
Large rewrite of the balloon driver. This one:

- turns balloon into a driver that attaches to xenbus(4). This allows to
disable the functionality either at compile time or boot time via
userconf(4). Driver can implement detach or pmf(9) hooks if deemed
necessary.

- keeps Cherry's locking model, but simplify it a bit. There is now
only one target value serialized inside balloon, we do not feedback
alternative value to Xenstore (clients are not expected to see its value
evolve behind their back, and can't do much about that either)

- implements min threshold; this is an admin-settable value that tells
driver to not balloon below this threshold. This can be used by domain
to keep memory reservations, useful if activity is expected in the near
future.

- in addition to min threshold, the driver implements internally a
safeguard value (uvmexp.freemin + 1MiB), so that admin cannot
inadvertently set min to a very low value forcing domain into heavy
memory pressure and swapping.

- create the sysctl(8) kern.xen.balloon tree. 4 nodes are actually present
(values are in KiB):
   - min: (rw) an admin-settable value that prevents ballooning below this
  mark
   - max: (ro) the maximum size for reservation, as set by xm(1) mem-max.
   - current: (ro) the current reservation for domain.
   - target:  (rw) the targetted reservation for domain.

- fix a few limitations here and there, most notably the max_reservation
hypercall, and KiB vs pages representations at interfaces.

The driver is still turned off by default. Enabling it would need more
approval, especially from bouyer@, cherry@ and cegger@.

FWIW: tested it two days long, from amd64 dom0 (with dom0 ballooning
enabled for xend), and bunch of domUs. Did not notice anything suspicious.

XXX it still has one big limitation: it cannot hotplug memory pages in
uvm(9) if they were not present beforehand. Example: ballooning above
physmem will give more pages to domain but it won't use it to serve
allocations, unless we teach uvm(9) how to handle the extra pages.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/i386/conf/XEN3_DOMU
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/xen/xen/balloon.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/xen/xenbus/xenbus_probe.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/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.65 src/sys/arch/amd64/conf/XEN3_DOM0:1.66
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.65	Sun Mar  6 17:08:19 2011
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Mon Apr 18 01:36:24 2011
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.65 2011/03/06 17:08:19 bouyer Exp $
+# $NetBSD: XEN3_DOM0,v 1.66 2011/04/18 01:36:24 jym Exp $
 
 include 	arch/amd64/conf/std.xen
 
@@ -12,7 +12,6 @@
 
 #
 options 	DOM0OPS
-#options XEN_BALLOON # Xen memory ballooning - Experimental
 
 # boot messages with MPBIOS, acpi and ioapic can be quite large
 options 	MSGBUFSIZE=24576
@@ -204,6 +203,7 @@
 xenbus*		at hypervisor?		# Xen virtual bus
 
 xencons*	at hypervisor?		# Xen virtual console
+#balloon*	at xenbus?		# Xen balloon device
 
 acpi0 		at hypervisor?
 #options 	ACPI_ACTIVATE_DEV	# If set, activate inactive devices

Index: src/sys/arch/amd64/conf/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.27 src/sys/arch/amd64/conf/XEN3_DOMU:1.28
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.27	Sun Mar  6 17:08:19 2011
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Mon Apr 18 01:36:24 2011
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.27 2011/03/06 17:08:19 bouyer Exp $
+# $NetBSD: XEN3_DOMU,v 1.28 2011/04/18 01:36:24 jym Exp $
 
 include 	arch/amd64/conf/std.xen
 
@@ -13,7 +13,6 @@
 #
 options 	MAXPHYS=32768   #xbd doesn't handle 64k transfers
 #options 	DOM0OPS
-#options XEN_BALLOON	# Xen memory ballooning - Experimental
 
 #options 	VM86		# virtual 8086 emulation
 #options 	USER_LDT	# user-settable LDT; used by WINE
@@ -158,6 +157,7 @@
 xenbus*		at hypervisor?		# Xen virtual bus
 xennet*		at xenbus?		# Xen virtual network interface
 xbd*		at xenbus?		# Xen virtual block device
+#balloon*	at xenbus?		# Xen balloon device
 
 xencons*	at hypervisor?		# Xen virtual console
 

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.47 src/sys/arch/i386/conf/XEN3_DOM0:1.48
--- 

CVS commit: src/sys/dev

2011-04-17 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Apr 18 01:47:28 UTC 2011

Modified Files:
src/sys/dev/ata: ata.c atavar.h
src/sys/dev/scsipi: scsiconf.c

Log Message:
Replace few simple_lock and ltsleep/wakeup uses with mutex(9) and condvar(9).

Note to all: please replace old primitives in your code! Thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.259 -r1.260 src/sys/dev/scsipi/scsiconf.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/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.113 src/sys/dev/ata/ata.c:1.114
--- src/sys/dev/ata/ata.c:1.113	Sun Mar 28 20:46:18 2010
+++ src/sys/dev/ata/ata.c	Mon Apr 18 01:47:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.113 2010/03/28 20:46:18 snj Exp $	*/
+/*	$NetBSD: ata.c,v 1.114 2011/04/18 01:47:28 rmind Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ata.c,v 1.113 2010/03/28 20:46:18 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ata.c,v 1.114 2011/04/18 01:47:28 rmind Exp $);
 
 #include opt_ata.h
 
@@ -42,7 +42,6 @@
 #include sys/errno.h
 #include sys/ataio.h
 #include sys/kmem.h
-#include sys/simplelock.h
 #include sys/intr.h
 #include sys/bus.h
 #include sys/once.h
@@ -74,18 +73,18 @@
 #define ATADEBUG_PRINT(args, level)
 #endif
 
+static ONCE_DECL(ata_init_ctrl);
 static struct pool ata_xfer_pool;
 
 /*
  * A queue of atabus instances, used to ensure the same bus probe order
- * for a given hardware configuration at each boot.
+ * for a given hardware configuration at each boot.  Kthread probing
+ * devices on a atabus.  Only one probing at once. 
  */
-struct atabus_initq_head atabus_initq_head =
-TAILQ_HEAD_INITIALIZER(atabus_initq_head);
-struct simplelock atabus_interlock = SIMPLELOCK_INITIALIZER;
-
-/* kernel thread probing devices on a atabus. Only one probing at once */
-struct lwp *atabus_configlwp;
+static TAILQ_HEAD(, atabus_initq)	atabus_initq_head;
+static kmutex_tatabus_qlock;
+static kcondvar_t			atabus_qcv;
+static lwp_t *atabus_cfg_lwp;
 
 /*
  * ATA bus layer.
@@ -111,6 +110,23 @@
 static void atabusconfig_thread(void *);
 
 /*
+ * atabus_init:
+ *
+ *	Initialize ATA subsystem structures.
+ */
+static int
+atabus_init(void)
+{
+
+	pool_init(ata_xfer_pool, sizeof(struct ata_xfer), 0, 0, 0,
+	ataspl, NULL, IPL_BIO);
+	TAILQ_INIT(atabus_initq_head);
+	mutex_init(atabus_qlock, MUTEX_DEFAULT, IPL_NONE);
+	cv_init(atabus_qcv, atainitq);
+	return 0;
+}
+
+/*
  * atabusprint:
  *
  *	Autoconfiguration print routine used by ATA controllers when
@@ -196,15 +212,14 @@
 	splx(s);
 
 	/* Make sure the devices probe in atabus order to avoid jitter. */
-	simple_lock(atabus_interlock);
-	while(1) {
+	mutex_enter(atabus_qlock);
+	for (;;) {
 		atabus_initq = TAILQ_FIRST(atabus_initq_head);
 		if (atabus_initq-atabus_sc == atabus_sc)
 			break;
-		ltsleep(atabus_initq_head, PRIBIO, ata_initq, 0,
-		atabus_interlock);
+		cv_wait(atabus_qcv, atabus_qlock);
 	}
-	simple_unlock(atabus_interlock);
+	mutex_exit(atabus_qlock);
 
 	/* If no drives, abort here */
 	for (i = 0; i  chp-ch_ndrive; i++)
@@ -219,19 +234,19 @@
 
 
 	if ((error = kthread_create(PRI_NONE, 0, NULL, atabusconfig_thread,
-	atabus_sc, atabus_configlwp,
+	atabus_sc, atabus_cfg_lwp,
 	%scnf, device_xname(atac-atac_dev))) != 0)
 		aprint_error_dev(atac-atac_dev,
 		unable to create config thread: error %d\n, error);
 	return;
 
  out:
-	simple_lock(atabus_interlock);
+	mutex_enter(atabus_qlock);
 	TAILQ_REMOVE(atabus_initq_head, atabus_initq, atabus_initq);
-	simple_unlock(atabus_interlock);
+	cv_broadcast(atabus_qcv);
+	mutex_exit(atabus_qlock);
 
 	free(atabus_initq, M_DEVBUF);
-	wakeup(atabus_initq_head);
 
 	ata_delref(chp);
 
@@ -248,13 +263,15 @@
 	struct atabus_softc *atabus_sc = arg;
 	struct ata_channel *chp = atabus_sc-sc_chan;
 	struct atac_softc *atac = chp-ch_atac;
-	int i, s;
 	struct atabus_initq *atabus_initq = NULL;
+	int i, s;
 
-	simple_lock(atabus_interlock);
+	/* XXX seems wrong */
+	mutex_enter(atabus_qlock);
 	atabus_initq = TAILQ_FIRST(atabus_initq_head);
-	simple_unlock(atabus_interlock);
 	KASSERT(atabus_initq-atabus_sc == atabus_sc);
+	mutex_exit(atabus_qlock);
+
 	/*
 	 * Attach an ATAPI bus, if needed.
 	 */
@@ -326,12 +343,12 @@
 	}
 	splx(s);
 
-	simple_lock(atabus_interlock);
+	mutex_enter(atabus_qlock);
 	TAILQ_REMOVE(atabus_initq_head, atabus_initq, atabus_initq);
-	simple_unlock(atabus_interlock);
+	cv_broadcast(atabus_qcv);
+	mutex_exit(atabus_qlock);
 
 	free(atabus_initq, M_DEVBUF);
-	wakeup(atabus_initq_head);
 
 	ata_delref(chp);
 
@@ -424,15 +441,6 @@
 	return (1);
 }
 
-static int
-atabus_xferpool_init(void)

CVS commit: src/share/mk

2011-04-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 18 02:16:55 UTC 2011

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Fix --sysroot usage.


To generate a diff of this commit:
cvs rdiff -u -r1.661 -r1.662 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.661 src/share/mk/bsd.own.mk:1.662
--- src/share/mk/bsd.own.mk:1.661	Sun Apr 17 15:03:37 2011
+++ src/share/mk/bsd.own.mk	Mon Apr 18 02:16:55 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.661 2011/04/17 15:03:37 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.662 2011/04/18 02:16:55 joerg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -207,12 +207,21 @@
 OBJC=		false
 .endif
 
-.if !defined(HOSTPROG)  !defined(HOSTLIB)  defined(DESTDIR)
+#
+# Make sure DESTDIR is set, so that builds with these tools always
+# get appropriate -nostdinc, -nostdlib, etc. handling.  The default is
+# empty string, meaning start from /, the root directory.
+#
+DESTDIR?=
+
+.if !defined(HOSTPROG)  !defined(HOSTLIB)
+.  if ${DESTDIR} != 
 CPPFLAGS+=	--sysroot=${DESTDIR}
 LDFLAGS+=	--sysroot=${DESTDIR}
-.else
+.  else
 CPPFLAGS+=	--sysroot=/
 LDFLAGS+=	--sysroot=/
+.  endif
 .endif
 .endif	# EXTERNAL_TOOLCHAIN		# }
 
@@ -411,16 +420,6 @@
 .endif
 .endif
 
-
-.if ${USETOOLS} == yes		# {
-#
-# Make sure DESTDIR is set, so that builds with these tools always
-# get appropriate -nostdinc, -nostdlib, etc. handling.  The default is
-# empty string, meaning start from /, the root directory.
-#
-DESTDIR?=
-.endif	# }
-
 #
 # Build a dynamically linked /bin and /sbin, with the necessary shared
 # libraries moved from /usr/lib to /lib and the shared linker moved



CVS commit: src/sys/arch/xen/xen

2011-04-17 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Apr 18 03:04:31 UTC 2011

Modified Files:
src/sys/arch/xen/xen: balloon.c

Log Message:
balloon_xenbus_attach: use KM_SLEEP for allocation.

Note: please do not use KM_NOSLEEP.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/xen/balloon.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/arch/xen/xen/balloon.c
diff -u src/sys/arch/xen/xen/balloon.c:1.7 src/sys/arch/xen/xen/balloon.c:1.8
--- src/sys/arch/xen/xen/balloon.c:1.7	Mon Apr 18 01:36:25 2011
+++ src/sys/arch/xen/xen/balloon.c	Mon Apr 18 03:04:31 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: balloon.c,v 1.7 2011/04/18 01:36:25 jym Exp $ */
+/* $NetBSD: balloon.c,v 1.8 2011/04/18 03:04:31 rmind Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 #define BALLOONDEBUG 0
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: balloon.c,v 1.7 2011/04/18 01:36:25 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: balloon.c,v 1.8 2011/04/18 03:04:31 rmind Exp $);
 
 #include sys/inttypes.h
 #include sys/device.h
@@ -229,11 +229,7 @@
 	sysctl_kern_xen_balloon_setup(sc);
 
 	/* List of MFNs passed from/to balloon for inflating/deflating */
-	mfn_list = kmem_alloc(BALLOON_DELTA * sizeof(*mfn_list), KM_NOSLEEP);
-	if (mfn_list == NULL) {
-		aprint_error_dev(self, could not allocate mfn_list\n);
-		goto error;
-	}
+	mfn_list = kmem_alloc(BALLOON_DELTA * sizeof(*mfn_list), KM_SLEEP);
 	sc-sc_mfn_list = mfn_list;
 
 	/* Setup xenbus node watch callback */



CVS commit: src/usr.bin/grep

2011-04-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 18 03:27:40 UTC 2011

Modified Files:
src/usr.bin/grep: fastgrep.c file.c grep.c queue.c util.c

Log Message:
Include nbtool_config.h for tool builds.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/grep/fastgrep.c src/usr.bin/grep/grep.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/grep/file.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/grep/queue.c
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/grep/util.c

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

Modified files:

Index: src/usr.bin/grep/fastgrep.c
diff -u src/usr.bin/grep/fastgrep.c:1.4 src/usr.bin/grep/fastgrep.c:1.5
--- src/usr.bin/grep/fastgrep.c:1.4	Sun Feb 27 17:33:37 2011
+++ src/usr.bin/grep/fastgrep.c	Mon Apr 18 03:27:40 2011
@@ -35,8 +35,12 @@
  * meantime, we need to use this workaround.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include nbtool_config.h
+#endif
+
 #include sys/cdefs.h
-__RCSID($NetBSD: fastgrep.c,v 1.4 2011/02/27 17:33:37 joerg Exp $);
+__RCSID($NetBSD: fastgrep.c,v 1.5 2011/04/18 03:27:40 joerg Exp $);
 
 #include limits.h
 #include stdbool.h
Index: src/usr.bin/grep/grep.c
diff -u src/usr.bin/grep/grep.c:1.4 src/usr.bin/grep/grep.c:1.5
--- src/usr.bin/grep/grep.c:1.4	Wed Feb 16 01:31:33 2011
+++ src/usr.bin/grep/grep.c	Mon Apr 18 03:27:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.4 2011/02/16 01:31:33 joerg Exp $	*/
+/*	$NetBSD: grep.c,v 1.5 2011/04/18 03:27:40 joerg Exp $	*/
 /* 	$FreeBSD: head/usr.bin/grep/grep.c 211519 2010-08-19 22:55:17Z delphij $	*/
 /*	$OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $	*/
 
@@ -29,8 +29,12 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include nbtool_config.h
+#endif
+
 #include sys/cdefs.h
-__RCSID($NetBSD: grep.c,v 1.4 2011/02/16 01:31:33 joerg Exp $);
+__RCSID($NetBSD: grep.c,v 1.5 2011/04/18 03:27:40 joerg Exp $);
 
 #include sys/stat.h
 #include sys/types.h

Index: src/usr.bin/grep/file.c
diff -u src/usr.bin/grep/file.c:1.5 src/usr.bin/grep/file.c:1.6
--- src/usr.bin/grep/file.c:1.5	Wed Feb 16 18:35:39 2011
+++ src/usr.bin/grep/file.c	Mon Apr 18 03:27:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.5 2011/02/16 18:35:39 joerg Exp $	*/
+/*	$NetBSD: file.c,v 1.6 2011/04/18 03:27:40 joerg Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/file.c 211496 2010-08-19 09:28:59Z des $	*/
 /*	$OpenBSD: file.c,v 1.11 2010/07/02 20:48:48 nicm Exp $	*/
 
@@ -30,8 +30,12 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include nbtool_config.h
+#endif
+
 #include sys/cdefs.h
-__RCSID($NetBSD: file.c,v 1.5 2011/02/16 18:35:39 joerg Exp $);
+__RCSID($NetBSD: file.c,v 1.6 2011/04/18 03:27:40 joerg Exp $);
 
 #include sys/param.h
 #include sys/types.h

Index: src/usr.bin/grep/queue.c
diff -u src/usr.bin/grep/queue.c:1.2 src/usr.bin/grep/queue.c:1.3
--- src/usr.bin/grep/queue.c:1.2	Wed Feb 16 01:31:33 2011
+++ src/usr.bin/grep/queue.c	Mon Apr 18 03:27:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: queue.c,v 1.2 2011/02/16 01:31:33 joerg Exp $	*/
+/*	$NetBSD: queue.c,v 1.3 2011/04/18 03:27:40 joerg Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/queue.c 211496 2010-08-19 09:28:59Z des $	*/
 /*-
  * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -31,8 +31,12 @@
  * Dodge.  It is used in place of sys/queue.h to get a better performance.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include nbtool_config.h
+#endif
+
 #include sys/cdefs.h
-__RCSID($NetBSD: queue.c,v 1.2 2011/02/16 01:31:33 joerg Exp $);
+__RCSID($NetBSD: queue.c,v 1.3 2011/04/18 03:27:40 joerg Exp $);
 
 #include sys/param.h
 #include sys/queue.h

Index: src/usr.bin/grep/util.c
diff -u src/usr.bin/grep/util.c:1.9 src/usr.bin/grep/util.c:1.10
--- src/usr.bin/grep/util.c:1.9	Sun Feb 27 17:33:37 2011
+++ src/usr.bin/grep/util.c	Mon Apr 18 03:27:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.9 2011/02/27 17:33:37 joerg Exp $	*/
+/*	$NetBSD: util.c,v 1.10 2011/04/18 03:27:40 joerg Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/util.c 211496 2010-08-19 09:28:59Z des $	*/
 /*	$OpenBSD: util.c,v 1.39 2010/07/02 22:18:03 tedu Exp $	*/
 
@@ -29,8 +29,12 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include nbtool_config.h
+#endif
+
 #include sys/cdefs.h
-__RCSID($NetBSD: util.c,v 1.9 2011/02/27 17:33:37 joerg Exp $);
+__RCSID($NetBSD: util.c,v 1.10 2011/04/18 03:27:40 joerg Exp $);
 
 #include sys/stat.h
 #include sys/types.h



CVS commit: src/usr.bin/grep

2011-04-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 18 03:47:40 UTC 2011

Modified Files:
src/usr.bin/grep: queue.c

Log Message:
Fix memory leaks.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/grep/queue.c

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

Modified files:

Index: src/usr.bin/grep/queue.c
diff -u src/usr.bin/grep/queue.c:1.3 src/usr.bin/grep/queue.c:1.4
--- src/usr.bin/grep/queue.c:1.3	Mon Apr 18 03:27:40 2011
+++ src/usr.bin/grep/queue.c	Mon Apr 18 03:47:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: queue.c,v 1.3 2011/04/18 03:27:40 joerg Exp $	*/
+/*	$NetBSD: queue.c,v 1.4 2011/04/18 03:47:40 joerg Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/queue.c 211496 2010-08-19 09:28:59Z des $	*/
 /*-
  * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -36,7 +36,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: queue.c,v 1.3 2011/04/18 03:27:40 joerg Exp $);
+__RCSID($NetBSD: queue.c,v 1.4 2011/04/18 03:47:40 joerg Exp $);
 
 #include sys/param.h
 #include sys/queue.h
@@ -71,8 +71,11 @@
 
 	STAILQ_INSERT_TAIL(queue, item, list);
 
-	if (++count  Bflag)
-		free(dequeue());
+	if (++count  Bflag) {
+		item = dequeue();
+		free(item-data.dat);
+		free(item);
+	}
 }
 
 static struct qentry *
@@ -96,6 +99,7 @@
 
 	while ((item = dequeue()) != NULL) {
 		printline(item-data, '-', (regmatch_t *)NULL, 0);
+		free(item-data.dat);
 		free(item);
 	}
 }
@@ -105,6 +109,8 @@
 {
 	struct qentry *item;
 
-	while ((item = dequeue()) != NULL)
+	while ((item = dequeue()) != NULL) {
+		free(item-data.dat);
 		free(item);
+	}
 }



CVS commit: src/usr.bin/grep

2011-04-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 18 03:48:23 UTC 2011

Modified Files:
src/usr.bin/grep: grep.c

Log Message:
Use the more portable getline.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/grep/grep.c

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

Modified files:

Index: src/usr.bin/grep/grep.c
diff -u src/usr.bin/grep/grep.c:1.5 src/usr.bin/grep/grep.c:1.6
--- src/usr.bin/grep/grep.c:1.5	Mon Apr 18 03:27:40 2011
+++ src/usr.bin/grep/grep.c	Mon Apr 18 03:48:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.5 2011/04/18 03:27:40 joerg Exp $	*/
+/*	$NetBSD: grep.c,v 1.6 2011/04/18 03:48:23 joerg Exp $	*/
 /* 	$FreeBSD: head/usr.bin/grep/grep.c 211519 2010-08-19 22:55:17Z delphij $	*/
 /*	$OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $	*/
 
@@ -34,7 +34,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: grep.c,v 1.5 2011/04/18 03:27:40 joerg Exp $);
+__RCSID($NetBSD: grep.c,v 1.6 2011/04/18 03:48:23 joerg Exp $);
 
 #include sys/stat.h
 #include sys/types.h
@@ -292,11 +292,15 @@
 	FILE *f;
 	char *line;
 	size_t len;
+	ssize_t rlen;
 
 	if ((f = fopen(fn, r)) == NULL)
 		err(2, %s, fn);
-	while ((line = fgetln(f, len)) != NULL)
-		add_pattern(line, *line == '\n' ? 0 : len);
+	line = NULL;
+	len = 0;
+	while ((rlen = getline(line, len, f)) != -1)
+		add_pattern(line, *line == '\n' ? 0 : (size_t)rlen);
+	free(line);
 	if (ferror(f))
 		err(2, %s, fn);
 	fclose(f);