CVS commit: src/sys/dev/acpi

2009-12-31 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Dec 31 10:02:51 UTC 2009

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
Add Intel HW Random Number Generator to the list of ignored HIDs.

ok pgoyette@, jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/dev/acpi/acpi.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/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.137 src/sys/dev/acpi/acpi.c:1.138
--- src/sys/dev/acpi/acpi.c:1.137	Thu Dec  3 21:04:29 2009
+++ src/sys/dev/acpi/acpi.c	Thu Dec 31 10:02:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.137 2009/12/03 21:04:29 cegger Exp $	*/
+/*	$NetBSD: acpi.c,v 1.138 2009/12/31 10:02:51 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.137 2009/12/03 21:04:29 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.138 2009/12/31 10:02:51 jruoho Exp $);
 
 #include opt_acpi.h
 #include opt_pcifixup.h
@@ -174,6 +174,7 @@
 	PNP0C01,	/* No System Board driver */
 	PNP0C02,	/* No PnP motherboard register resources driver */
 	PNP0C0F,	/* ACPI PCI link devices are handled internally */
+	INT0800,	/* Intel HW RNG is handled internally */
 #endif
 #if defined(x86_64)
 	PNP0C04,	/* FPU is handled internally */



CVS commit: src/sys/dev/acpi

2009-12-31 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Dec 31 10:07:13 UTC 2009

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
Remove unused locking variables.

ok pgoyette@, jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/dev/acpi/acpi.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/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.138 src/sys/dev/acpi/acpi.c:1.139
--- src/sys/dev/acpi/acpi.c:1.138	Thu Dec 31 10:02:51 2009
+++ src/sys/dev/acpi/acpi.c	Thu Dec 31 10:07:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.138 2009/12/31 10:02:51 jruoho Exp $	*/
+/*	$NetBSD: acpi.c,v 1.139 2009/12/31 10:07:13 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.138 2009/12/31 10:02:51 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.139 2009/12/31 10:07:13 jruoho Exp $);
 
 #include opt_acpi.h
 #include opt_pcifixup.h
@@ -158,8 +158,6 @@
 /*
  * Locking stuff.
  */
-static kmutex_t acpi_slock;
-static int acpi_locked;
 extern kmutex_t acpi_interrupt_list_mtx;
 
 /*
@@ -225,9 +223,7 @@
 		panic(acpi_probe: ACPI has already been probed);
 	beenhere = 1;
 
-	mutex_init(acpi_slock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(acpi_interrupt_list_mtx, MUTEX_DEFAULT, IPL_NONE);
-	acpi_locked = 0;
 
 	/*
 	 * Start up ACPICA.



CVS commit: src/sys/dev/acpi

2009-12-31 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Dec 31 10:12:51 UTC 2009

Modified Files:
src/sys/dev/acpi: acpi_lid.c

Log Message:
As the _PSW control method was deprecated in ACPI 3.0, augment the wake
event call with the newer _DSW control method.

ok pgoyette@, jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/acpi/acpi_lid.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/acpi/acpi_lid.c
diff -u src/sys/dev/acpi/acpi_lid.c:1.29 src/sys/dev/acpi/acpi_lid.c:1.30
--- src/sys/dev/acpi/acpi_lid.c:1.29	Sun Nov 29 21:32:50 2009
+++ src/sys/dev/acpi/acpi_lid.c	Thu Dec 31 10:12:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_lid.c,v 1.29 2009/11/29 21:32:50 cegger Exp $	*/
+/*	$NetBSD: acpi_lid.c,v 1.30 2009/12/31 10:12:51 jruoho Exp $	*/
 
 /*
  * Copyright 2001, 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_lid.c,v 1.29 2009/11/29 21:32:50 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_lid.c,v 1.30 2009/12/31 10:12:51 jruoho Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -153,15 +153,41 @@
 acpilid_wake_event(device_t dv, bool enable)
 {
 	struct acpilid_softc *sc = device_private(dv);
-
+	ACPI_OBJECT_LIST arg;
+	ACPI_OBJECT obj[3];
 	ACPI_STATUS rv;
 
+	/*
+	 * First try to call the Device Sleep Wake control method, _DSW.
+	 * Only if this is not available, resort to to the Power State
+	 * Wake control method, _PSW, which was deprecated in ACPI 3.0.
+	 */
+	obj[0].Integer.Value = enable ? 1 : 0;
+	obj[1].Integer.Value = obj[2].Integer.Value = 0;
+	obj[0].Type = obj[1].Type = obj[2].Type = ACPI_TYPE_INTEGER;
+
+	arg.Count = 3;
+	arg.Pointer = obj;
+
+	rv = AcpiEvaluateObject(sc-sc_node-ad_handle, _DSW, arg, NULL);
+
+	if (ACPI_SUCCESS(rv))
+		return;
+
+	if (rv != AE_NOT_FOUND)
+		goto fail;
+
 	rv = acpi_eval_set_integer(sc-sc_node-ad_handle, _PSW,
 	enable ? 1 : 0);
+
 	if (ACPI_FAILURE(rv)  rv != AE_NOT_FOUND)
-		aprint_error_dev(dv,
-		unable to evaluate _PSW handler: %s\n,
-		AcpiFormatException(rv));
+		goto fail;
+
+	return;
+
+fail:
+	aprint_error_dev(dv, unable to evaluate wake control method: %s\n,
+	AcpiFormatException(rv));
 }
 
 /*



CVS commit: src/sys/arch/evbppc/virtex/dev

2009-12-31 Thread Jachym Holecek
Module Name:src
Committed By:   freza
Date:   Thu Dec 31 13:10:47 UTC 2009

Modified Files:
src/sys/arch/evbppc/virtex/dev: if_temac.c

Log Message:
Remove unused variable, makes VIRTEX_* kernels compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/virtex/dev/if_temac.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/evbppc/virtex/dev/if_temac.c
diff -u src/sys/arch/evbppc/virtex/dev/if_temac.c:1.4 src/sys/arch/evbppc/virtex/dev/if_temac.c:1.5
--- src/sys/arch/evbppc/virtex/dev/if_temac.c:1.4	Tue Feb 12 18:03:43 2008
+++ src/sys/arch/evbppc/virtex/dev/if_temac.c	Thu Dec 31 13:10:46 2009
@@ -1,4 +1,4 @@
-/* 	$NetBSD: if_temac.c,v 1.4 2008/02/12 18:03:43 dyoung Exp $ */
+/* 	$NetBSD: if_temac.c,v 1.5 2009/12/31 13:10:46 freza Exp $ */
 
 /*
  * Copyright (c) 2006 Jachym Holecek
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_temac.c,v 1.4 2008/02/12 18:03:43 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_temac.c,v 1.5 2009/12/31 13:10:46 freza Exp $);
 
 #include bpfilter.h
 
@@ -649,7 +649,6 @@
 temac_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
 	struct temac_softc 	*sc = (struct temac_softc *)ifp-if_softc;
-	struct ifreq 		*ifr = (struct ifreq *)data;
 	int 			s, ret;
 
 	s = splnet();



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

2009-12-31 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Dec 31 15:42:46 UTC 2009

Modified Files:
src/sys/arch/hp300/include: disklabel.h

Log Message:
Don't use DEV_BSIZE for LABELSECTOR.
We have never supported 256byte/sector media, and
current definition won't work on 512byte/sector media.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp300/include/disklabel.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/hp300/include/disklabel.h
diff -u src/sys/arch/hp300/include/disklabel.h:1.2 src/sys/arch/hp300/include/disklabel.h:1.3
--- src/sys/arch/hp300/include/disklabel.h:1.2	Tue Dec  6 17:06:00 2005
+++ src/sys/arch/hp300/include/disklabel.h	Thu Dec 31 15:42:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.h,v 1.2 2005/12/06 17:06:00 tsutsui Exp $	*/
+/*	$NetBSD: disklabel.h,v 1.3 2009/12/31 15:42:46 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -33,7 +33,7 @@
 #ifndef _HP300_DISKLABEL_H_
 #define _HP300_DISKLABEL_H_
 
-#define	LABELSECTOR	(1024 / DEV_BSIZE)	/* sector containing label */
+#define	LABELSECTOR	2			/* sector containing label */
 #define	LABELOFFSET	0			/* offset of label in sector */
 #define	MAXPARTITIONS	8			/* number of partitions */
 #define	RAW_PART	2			/* raw partition: xx?c */



CVS commit: src/lib/libedit

2009-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 31 15:58:26 UTC 2009

Modified Files:
src/lib/libedit: Makefile editline.3 el.c el.h eln.c histedit.h
prompt.c read.c

Log Message:
- Document and enable wide character support.
- Fix read function compatibility.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libedit/Makefile
cvs rdiff -u -r1.70 -r1.71 src/lib/libedit/editline.3
cvs rdiff -u -r1.57 -r1.58 src/lib/libedit/el.c
cvs rdiff -u -r1.20 -r1.21 src/lib/libedit/el.h
cvs rdiff -u -r1.2 -r1.3 src/lib/libedit/eln.c
cvs rdiff -u -r1.43 -r1.44 src/lib/libedit/histedit.h
cvs rdiff -u -r1.17 -r1.18 src/lib/libedit/prompt.c
cvs rdiff -u -r1.53 -r1.54 src/lib/libedit/read.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/libedit/Makefile
diff -u src/lib/libedit/Makefile:1.39 src/lib/libedit/Makefile:1.40
--- src/lib/libedit/Makefile:1.39	Wed Dec 30 18:54:52 2009
+++ src/lib/libedit/Makefile	Thu Dec 31 10:58:26 2009
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.39 2009/12/30 23:54:52 christos Exp $
+#	$NetBSD: Makefile,v 1.40 2009/12/31 15:58:26 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
 
 USE_SHLIBDIR=	yes
 
-WIDECHAR ?= no
+WIDECHAR ?= yes
 WARNS=	4
 LIB=	edit
 
@@ -26,12 +26,13 @@
 	editline.3 tok_line.3 editline.3 tok_str.3
 
 # For speed and debugging
-SRCS=   ${OSRCS} readline.c tokenizer.c history.c
+#SRCS=   ${OSRCS} readline.c tokenizer.c history.c
 # For protection
-#SRCS=	editline.c readline.c tokenizer.c history.c
+SRCS=	editline.c readline.c tokenizer.c history.c
 
 .if ${WIDECHAR} == yes
-SRCS += tokenizern.c historyn.c eln.c
+OSRCS += eln.c
+SRCS += tokenizern.c historyn.c
 CLEANFILES+=tokenizern.c.tmp tokenizern.c historyn.c.tmp historyn.c
 CPPFLAGS+=-DWIDECHAR
 .endif

Index: src/lib/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.70 src/lib/libedit/editline.3:1.71
--- src/lib/libedit/editline.3:1.70	Sun Jul  5 17:55:24 2009
+++ src/lib/libedit/editline.3	Thu Dec 31 10:58:26 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: editline.3,v 1.70 2009/07/05 21:55:24 perry Exp $
+.\	$NetBSD: editline.3,v 1.71 2009/12/31 15:58:26 christos Exp $
 .\
 .\ Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -26,7 +26,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd July 5, 2009
+.Dd December 31, 2009
 .Dt EDITLINE 3
 .Os
 .Sh NAME
@@ -35,24 +35,41 @@
 .Nm el_end ,
 .Nm el_reset ,
 .Nm el_gets ,
+.Nm el_wgets ,
 .Nm el_getc ,
+.Nm el_wgetc ,
 .Nm el_push ,
+.Nm el_wpush ,
 .Nm el_parse ,
+.Nm el_wparse ,
 .Nm el_set ,
+.Nm el_wset ,
 .Nm el_get ,
+.Nm el_wget ,
 .Nm el_source ,
 .Nm el_resize ,
 .Nm el_line ,
+.Nm el_wline ,
 .Nm el_insertstr ,
+.Nm el_winsertstr ,
 .Nm el_deletestr ,
+.Nm el_wdeletestr ,
 .Nm history_init ,
+.Nm history_winit ,
 .Nm history_end ,
+.Nm history_wend ,
 .Nm history ,
+.Nm historyw ,
 .Nm tok_init ,
+.Nm tok_winit ,
 .Nm tok_end ,
+.Nm tok_wend ,
 .Nm tok_reset ,
+.Nm tok_wreset ,
 .Nm tok_line ,
+.Nm tok_wline ,
 .Nm tok_str
+.Nm tok_wstr
 .Nd line editor, history and tokenization functions
 .Sh LIBRARY
 .Lb libedit
@@ -66,17 +83,29 @@
 .Fn el_reset EditLine *e
 .Ft const char *
 .Fn el_gets EditLine *e int *count
+.Ft const wchar_t *
+.Fn el_wgets EditLine *e int *count
 .Ft int
 .Fn el_getc EditLine *e char *ch
+.Ft int
+.Fn el_wgetc EditLine *e wchar_t *ch
 .Ft void
 .Fn el_push EditLine *e const char *str
+.Ft void
+.Fn el_wpush EditLine *e const wchar_t *str
 .Ft int
 .Fn el_parse EditLine *e int argc const char *argv[]
 .Ft int
+.Fn el_wparse EditLine *e int argc const wchar_t *argv[]
+.Ft int
 .Fn el_set EditLine *e int op ...
 .Ft int
+.Fn el_wset EditLine *e int op ...
+.Ft int
 .Fn el_get EditLine *e int op ...
 .Ft int
+.Fn el_wget EditLine *e int op ...
+.Ft int
 .Fn el_source EditLine *e const char *file
 .Ft void
 .Fn el_resize EditLine *e
@@ -84,24 +113,44 @@
 .Fn el_line EditLine *e
 .Ft int
 .Fn el_insertstr EditLine *e const char *str
+.Ft int
+.Fn el_winsertstr EditLine *e const wchar_t *str
 .Ft void
 .Fn el_deletestr EditLine *e int count
+.Ft void
+.Fn el_wdeletestr EditLine *e int count
 .Ft History *
 .Fn history_init
+.Ft HistoryW *
+.Fn history_winit
 .Ft void
 .Fn history_end History *h
+.Ft void
+.Fn history_wend HistoryW *h
 .Ft int
 .Fn history History *h HistEvent *ev int op ...
+.Ft int
+.Fn historyw HistoryW *h HistEventW *ev int op ...
 .Ft Tokenizer *
 .Fn tok_init const char *IFS
+.Ft TokenizerW *
+.Fn tok_winit const wchar_t *IFS
 .Ft void
 .Fn tok_end Tokenizer *t
 .Ft void
+.Fn tok_wend TokenizerW *t
+.Ft void
 .Fn tok_reset Tokenizer *t
+.Ft void
+.Fn tok_wreset TokenizerW *t
 .Ft int
 .Fn tok_line Tokenizer *t const LineInfo *li int *argc const char **argv[] int *cursorc int *cursoro
 .Ft int
+.Fn tok_wline TokenizerW *t const LineInfoW *li int *argc const wchar_t **argv[] 

CVS commit: src/sys/arch/arm/arm32

2009-12-31 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Dec 31 16:00:53 UTC 2009

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
pmap_page_remove(): remove an unused local variable; no functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/sys/arch/arm/arm32/pmap.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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.207 src/sys/arch/arm/arm32/pmap.c:1.208
--- src/sys/arch/arm/arm32/pmap.c:1.207	Thu Dec 31 02:36:14 2009
+++ src/sys/arch/arm/arm32/pmap.c	Thu Dec 31 16:00:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.207 2009/12/31 02:36:14 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.208 2009/12/31 16:00:53 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.207 2009/12/31 02:36:14 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.208 2009/12/31 16:00:53 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -2565,7 +2565,7 @@
 	struct l2_bucket *l2b;
 	struct pv_entry *pv, *npv, **pvp;
 	pmap_t pm, curpm;
-	pt_entry_t *ptep, pte;
+	pt_entry_t *ptep;
 	bool flush;
 	u_int flags;
 
@@ -2647,7 +2647,6 @@
 		KDASSERT(l2b != NULL);
 
 		ptep = l2b-l2b_kva[l2pte_index(pv-pv_va)];
-		pte = *ptep;
 
 		/*
 		 * Update statistics



CVS commit: src/sys/arch/i386/i386

2009-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 31 16:04:32 UTC 2009

Modified Files:
src/sys/arch/i386/i386: apmbios.c

Log Message:
Fix compilation issue with time_t


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/i386/i386/apmbios.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/i386/i386/apmbios.c
diff -u src/sys/arch/i386/i386/apmbios.c:1.15 src/sys/arch/i386/i386/apmbios.c:1.16
--- src/sys/arch/i386/i386/apmbios.c:1.15	Fri Nov 20 22:11:00 2009
+++ src/sys/arch/i386/i386/apmbios.c	Thu Dec 31 11:04:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: apmbios.c,v 1.15 2009/11/21 03:11:00 rmind Exp $ */
+/*	$NetBSD: apmbios.c,v 1.16 2009/12/31 16:04:32 christos Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: apmbios.c,v 1.15 2009/11/21 03:11:00 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: apmbios.c,v 1.16 2009/12/31 16:04:32 christos Exp $);
 
 #include opt_apm.h
 #include opt_compat_mach.h	/* Needed to get the right segment def */
@@ -221,6 +221,7 @@
 	const char *name;
 	int inf;
 	int outf = 0; /* XXX: gcc */
+	long long milli;
 		
 	if (print) {
 		if (func = sizeof(aci) / sizeof(aci[0])) {
@@ -232,12 +233,13 @@
 			outf = aci[func].outflag;
 		}
 		inittodr(time_second);	/* update timestamp */
+		milli = time_second % 1000;
 		if (name)
-			printf(apmc...@%03ld: %s/%#x (line=%d) , 
-time_second % 1000, name, func, line);
+			printf(apmc...@%03lld: %s/%#x (line=%d) , 
+			milli, name, func, line);
 		else
-			printf(apmc...@%03ld: %#x (line=%d) , 
-time_second % 1000, func, line);
+			printf(apmc...@%03lld: %#x (line=%d) , 
+			milli, func, line);
 		acallpr(inf, in:, regs);
 	}
 	rv = apmcall(func, regs);



CVS commit: src/lib/libedit

2009-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 31 18:32:37 UTC 2009

Modified Files:
src/lib/libedit: chartype.c chartype.h

Log Message:
expose the encode and decode string functions for the benefit of history
and readline.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libedit/chartype.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libedit/chartype.h

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

Modified files:

Index: src/lib/libedit/chartype.c
diff -u src/lib/libedit/chartype.c:1.1 src/lib/libedit/chartype.c:1.2
--- src/lib/libedit/chartype.c:1.1	Wed Dec 30 17:37:40 2009
+++ src/lib/libedit/chartype.c	Thu Dec 31 13:32:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.c,v 1.1 2009/12/30 22:37:40 christos Exp $	*/
+/*	$NetBSD: chartype.c,v 1.2 2009/12/31 18:32:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 #include config.h
 #if !defined(lint)  !defined(SCCSID)
-__RCSID($NetBSD: chartype.c,v 1.1 2009/12/30 22:37:40 christos Exp $);
+__RCSID($NetBSD: chartype.c,v 1.2 2009/12/31 18:32:37 christos Exp $);
 #endif /* not lint  not SCCSID */
 #include el.h
 #include stdlib.h
@@ -75,7 +75,7 @@
 }
 
 
-protected char *
+public char *
 ct_encode_string(const Char *s, ct_buffer_t *conv)
 {
 	char *dst;
@@ -115,7 +115,7 @@
 	return conv-cbuff;
 }
 
-protected Char *
+public Char *
 ct_decode_string(const char *s, ct_buffer_t *conv)
 {
 	size_t len = 0;

Index: src/lib/libedit/chartype.h
diff -u src/lib/libedit/chartype.h:1.2 src/lib/libedit/chartype.h:1.3
--- src/lib/libedit/chartype.h:1.2	Wed Dec 30 18:54:52 2009
+++ src/lib/libedit/chartype.h	Thu Dec 31 13:32:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.h,v 1.2 2009/12/30 23:54:52 christos Exp $	*/
+/*	$NetBSD: chartype.h,v 1.3 2009/12/31 18:32:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -171,11 +171,13 @@
 size_t  wsize;
 } ct_buffer_t;
 
+#define ct_encode_string __ct_encode_string
 /* Encode a wide character string and return the UTF-8 encoded result. */
-protected char *ct_encode_string(const Char *, ct_buffer_t *);
+public char *ct_encode_string(const Char *, ct_buffer_t *);
 
+#define ct_decode_string __ct_decode_string
 /* Decode a (multi)?byte string and return the wide character string result. */
-protected Char *ct_decode_string(const char *, ct_buffer_t *);
+public Char *ct_decode_string(const char *, ct_buffer_t *);
 
 /* Decode a (multi)?byte argv string array.
  * The pointer returned must be free()d when done. */



CVS commit: src/sys/arch/arm/arm32

2009-12-31 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Dec 31 18:34:56 UTC 2009

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Use pmap_is_current() where appropriate.  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.208 -r1.209 src/sys/arch/arm/arm32/pmap.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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.208 src/sys/arch/arm/arm32/pmap.c:1.209
--- src/sys/arch/arm/arm32/pmap.c:1.208	Thu Dec 31 16:00:53 2009
+++ src/sys/arch/arm/arm32/pmap.c	Thu Dec 31 18:34:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.208 2009/12/31 16:00:53 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.209 2009/12/31 18:34:56 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.208 2009/12/31 16:00:53 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.209 2009/12/31 18:34:56 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -2369,10 +2369,9 @@
 	 * user vmspace, we only need to flush the page if it is in the
 	 * current pmap.
 	 */
-	pm = curproc-p_vmspace-vm_map.pmap;
 
 	for (npv = pv; npv; npv = SLIST_NEXT(npv, pv_link)) {
-		if (npv-pv_pmap == pmap_kernel() || npv-pv_pmap == pm) {
+		if (pmap_is_current(npv-pv_pmap)) {
 			flags |= npv-pv_flags;
 			/*
 			 * The page is mapped non-cacheable in 
@@ -2406,6 +2405,8 @@
 			pmap_dcache_wb_range(pm_to_clean, page_to_clean,
 			PAGE_SIZE, !is_src, (flags  PVF_WRITE) == 0);
 	} else if (cache_needs_cleaning) {
+		pmap_t const pm = curproc-p_vmspace-vm_map.pmap;
+
 		if (PV_BEEN_EXECD(flags))
 			pmap_idcache_wbinv_all(pm);
 		else
@@ -2564,7 +2565,7 @@
 {
 	struct l2_bucket *l2b;
 	struct pv_entry *pv, *npv, **pvp;
-	pmap_t pm, curpm;
+	pmap_t pm;
 	pt_entry_t *ptep;
 	bool flush;
 	u_int flags;
@@ -2606,7 +2607,6 @@
 
 	flush = false;
 	flags = 0;
-	curpm = curproc-p_vmspace-vm_map.pmap;
 
 #ifdef PMAP_CACHE_VIVT
 	pmap_clean_page(pv, false);
@@ -2616,7 +2616,7 @@
 	while (pv) {
 		pm = pv-pv_pmap;
 		npv = SLIST_NEXT(pv, pv_link);
-		if (flush == false  (pm == curpm || pm == pmap_kernel()))
+		if (flush == false  pmap_is_current(pm))
 			flush = true;
 
 		if (pm == pmap_kernel()) {



CVS commit: src/sys/nfs

2009-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 31 19:30:45 UTC 2009

Modified Files:
src/sys/nfs: files.nfs

Log Message:
nuidhash_max is needed by sys_nfssvc


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/nfs/files.nfs

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/files.nfs
diff -u src/sys/nfs/files.nfs:1.9 src/sys/nfs/files.nfs:1.10
--- src/sys/nfs/files.nfs:1.9	Wed Nov 19 13:36:09 2008
+++ src/sys/nfs/files.nfs	Thu Dec 31 14:30:45 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.nfs,v 1.9 2008/11/19 18:36:09 ad Exp $
+#	$NetBSD: files.nfs,v 1.10 2009/12/31 19:30:45 christos Exp $
 
 deffs	fs_nfs.h		NFS
 
@@ -23,7 +23,7 @@
 file	nfs/nfs_bootparam.c	nfs  nfs_boot_bootparam
 file	nfs/nfs_bootstatic.c	nfs  nfs_boot_bootstatic
 file	nfs/nfs_export.c	nfsserver
-file	nfs/nfs_iod.c		nfs
+file	nfs/nfs_iod.c		nfsserver | nfs
 file	nfs/nfs_kq.c		nfs
 file	nfs/nfs_node.c		nfs
 file	nfs/nfs_serv.c		nfsserver



CVS commit: src/sys/nfs

2009-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 31 19:31:31 UTC 2009

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

Log Message:
appease gcc.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/nfs/nfs_socket.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_socket.c
diff -u src/sys/nfs/nfs_socket.c:1.183 src/sys/nfs/nfs_socket.c:1.184
--- src/sys/nfs/nfs_socket.c:1.183	Sun Dec  6 13:00:15 2009
+++ src/sys/nfs/nfs_socket.c	Thu Dec 31 14:31:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_socket.c,v 1.183 2009/12/06 18:00:15 dyoung Exp $	*/
+/*	$NetBSD: nfs_socket.c,v 1.184 2009/12/31 19:31:31 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_socket.c,v 1.183 2009/12/06 18:00:15 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_socket.c,v 1.184 2009/12/31 19:31:31 christos Exp $);
 
 #ifdef _KERNEL_OPT
 #include fs_nfs.h
@@ -120,8 +120,8 @@
  * the nfs timer and reply error debugs every 10 seconds.
  */
 static const struct timeval nfs_err_interval = { 10, 0 };
-static struct timeval nfs_reply_last_err_time;
-static struct timeval nfs_timer_last_err_time;
+static struct timeval nfs_reply_last_err_time __attribute__((__used__));
+static struct timeval nfs_timer_last_err_time __attribute__((__used__));
 #endif
 
 /*



CVS commit: src/sys/nfs

2009-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 31 19:38:16 UTC 2009

Modified Files:
src/sys/nfs: files.nfs nfs_iod.c nfs_syscalls.c

Log Message:
handle the nuidhash_max lossage differently


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/nfs/files.nfs
cvs rdiff -u -r1.3 -r1.4 src/sys/nfs/nfs_iod.c
cvs rdiff -u -r1.151 -r1.152 src/sys/nfs/nfs_syscalls.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/files.nfs
diff -u src/sys/nfs/files.nfs:1.10 src/sys/nfs/files.nfs:1.11
--- src/sys/nfs/files.nfs:1.10	Thu Dec 31 14:30:45 2009
+++ src/sys/nfs/files.nfs	Thu Dec 31 14:38:16 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.nfs,v 1.10 2009/12/31 19:30:45 christos Exp $
+#	$NetBSD: files.nfs,v 1.11 2009/12/31 19:38:16 christos Exp $
 
 deffs	fs_nfs.h		NFS
 
@@ -23,7 +23,7 @@
 file	nfs/nfs_bootparam.c	nfs  nfs_boot_bootparam
 file	nfs/nfs_bootstatic.c	nfs  nfs_boot_bootstatic
 file	nfs/nfs_export.c	nfsserver
-file	nfs/nfs_iod.c		nfsserver | nfs
+file	nfs/nfs_iod.c		nfs
 file	nfs/nfs_kq.c		nfs
 file	nfs/nfs_node.c		nfs
 file	nfs/nfs_serv.c		nfsserver

Index: src/sys/nfs/nfs_iod.c
diff -u src/sys/nfs/nfs_iod.c:1.3 src/sys/nfs/nfs_iod.c:1.4
--- src/sys/nfs/nfs_iod.c:1.3	Sat Mar 14 17:04:25 2009
+++ src/sys/nfs/nfs_iod.c	Thu Dec 31 14:38:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_iod.c,v 1.3 2009/03/14 21:04:25 dsl Exp $	*/
+/*	$NetBSD: nfs_iod.c,v 1.4 2009/12/31 19:38:16 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_iod.c,v 1.3 2009/03/14 21:04:25 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_iod.c,v 1.4 2009/12/31 19:38:16 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -75,7 +75,7 @@
 #include nfs/nfsrtt.h
 #include nfs/nfs_var.h
 
-int nuidhash_max = NFS_MAXUIDHASH;
+extern int nuidhash_max;
 
 /*
  * locking order:

Index: src/sys/nfs/nfs_syscalls.c
diff -u src/sys/nfs/nfs_syscalls.c:1.151 src/sys/nfs/nfs_syscalls.c:1.152
--- src/sys/nfs/nfs_syscalls.c:1.151	Wed Oct 21 17:12:06 2009
+++ src/sys/nfs/nfs_syscalls.c	Thu Dec 31 14:38:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_syscalls.c,v 1.151 2009/10/21 21:12:06 rmind Exp $	*/
+/*	$NetBSD: nfs_syscalls.c,v 1.152 2009/12/31 19:38:16 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_syscalls.c,v 1.151 2009/10/21 21:12:06 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_syscalls.c,v 1.152 2009/12/31 19:38:16 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -79,7 +79,7 @@
 		struct nfssvc_sock *,
 		struct lwp *, struct mbuf **);
 extern int nfsrvw_procrastinate;
-extern int nuidhash_max;
+int nuidhash_max = NFS_MAXUIDHASH;
 
 static int nfs_numnfsd = 0;
 static struct nfsdrt nfsdrt;



CVS commit: src/usr.sbin/user

2009-12-31 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Dec 31 19:59:31 UTC 2009

Modified Files:
src/usr.sbin/user: user.c usermgmt.conf.5

Log Message:
Add new keyword gid_range to usermgmt.conf which specifies a default
GID range for groupadd(8).


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/usr.sbin/user/user.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/user/usermgmt.conf.5

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/user/user.c
diff -u src/usr.sbin/user/user.c:1.124 src/usr.sbin/user/user.c:1.125
--- src/usr.sbin/user/user.c:1.124	Thu Oct 15 23:03:02 2009
+++ src/usr.sbin/user/user.c	Thu Dec 31 19:59:31 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: user.c,v 1.124 2009/10/15 23:03:02 hubertf Exp $ */
+/* $NetBSD: user.c,v 1.125 2009/12/31 19:59:31 mlelstv Exp $ */
 
 /*
  * Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT(@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.);
-__RCSID($NetBSD: user.c,v 1.124 2009/10/15 23:03:02 hubertf Exp $);
+__RCSID($NetBSD: user.c,v 1.125 2009/12/31 19:59:31 mlelstv Exp $);
 #endif
 
 #include sys/types.h
@@ -71,7 +71,14 @@
 	int	r_to;		/* high uid */
 } range_t;
 
-/* this struct encapsulates the user information */
+typedef struct rangelist_t {
+	unsigned	rl_rsize;		/* size of range array */
+	unsigned	rl_rc;			/* # of ranges */
+	range_t	   *rl_rv;			/* the ranges */
+	unsigned	rl_defrc;		/* # of ranges in defaults */
+} rangelist_t;
+
+/* this struct encapsulates the user and group information */
 typedef struct user_t {
 	int		u_flags;		/* see below */
 	int		u_uid;			/* uid of user */
@@ -88,14 +95,30 @@
 	char	   *u_inactive;		/* when account will expire */
 	char	   *u_skeldir;		/* directory for startup files */
 	char	   *u_class;		/* login class */
-	unsigned	u_rsize;		/* size of range array */
-	unsigned	u_rc;			/* # of ranges */
-	range_t	   *u_rv;			/* the ranges */
+	rangelist_t 	u_r;			/* list of ranges */
 	unsigned	u_defrc;		/* # of ranges in defaults */
 	int		u_preserve;		/* preserve uids on deletion */
 	int		u_allow_samba;		/* allow trailing '$' for samba login names */
 	int		u_locked;		/* user account lock */
 } user_t;
+#define u_rsize u_r.rl_rsize
+#define u_rcu_r.rl_rc
+#define u_rvu_r.rl_rv
+#define u_defrc u_r.rl_defrc
+
+/* this struct encapsulates the user and group information */
+typedef struct group_t {
+	rangelist_t	g_r;			/* list of ranges */
+} group_t;
+#define g_rsize g_r.rl_rsize
+#define g_rcg_r.rl_rc
+#define g_rvg_r.rl_rv
+#define g_defrc g_r.rl_defrc
+
+typedef struct def_t {
+	user_t user;
+	group_t group;
+} def_t;
 
 /* flags for which fields of the user_t replace the passwd entry */
 enum {
@@ -182,9 +205,6 @@
 	PasswordLength = 2048,
 
 	DES_Len = 13,
-
-	LowGid = DEF_LOWUID,
-	HighGid = DEF_HIGHUID
 };
 
 /* Full paths of programs used here */
@@ -682,30 +702,30 @@
 #ifdef EXTENSIONS
 /* save a range of uids */
 static int
-save_range(user_t *up, char *cp)
+save_range(rangelist_t *rlp, char *cp)
 {
 	int	from;
 	int	to;
 	int	i;
 
-	if (up-u_rsize == 0) {
-		up-u_rsize = 32;
-		NEWARRAY(range_t, up-u_rv, up-u_rsize, return(0));
-	} else if (up-u_rc == up-u_rsize) {
-		up-u_rsize *= 2;
-		RENEW(range_t, up-u_rv, up-u_rsize, return(0));
-	}
-	if (up-u_rv  sscanf(cp, %d..%d, from, to) == 2) {
-		for (i = up-u_defrc ; i  up-u_rc ; i++) {
-			if (up-u_rv[i].r_from == from 
-			up-u_rv[i].r_to == to) {
+	if (rlp-rl_rsize == 0) {
+		rlp-rl_rsize = 32;
+		NEWARRAY(range_t, rlp-rl_rv, rlp-rl_rsize, return(0));
+	} else if (rlp-rl_rc == rlp-rl_rsize) {
+		rlp-rl_rsize *= 2;
+		RENEW(range_t, rlp-rl_rv, rlp-rl_rsize, return(0));
+	}
+	if (rlp-rl_rv  sscanf(cp, %d..%d, from, to) == 2) {
+		for (i = rlp-rl_defrc ; i  rlp-rl_rc ; i++) {
+			if (rlp-rl_rv[i].r_from == from 
+			rlp-rl_rv[i].r_to == to) {
 break;
 			}
 		}
-		if (i == up-u_rc) {
-			up-u_rv[up-u_rc].r_from = from;
-			up-u_rv[up-u_rc].r_to = to;
-			up-u_rc += 1;
+		if (i == rlp-rl_rc) {
+			rlp-rl_rv[rlp-rl_rc].r_from = from;
+			rlp-rl_rv[rlp-rl_rc].r_to = to;
+			rlp-rl_rc += 1;
 		}
 	} else {
 		warnx(Bad range `%s', cp);
@@ -778,7 +798,7 @@
 
 /* read the defaults file */
 static void
-read_defaults(user_t *up)
+read_defaults(def_t *dp)
 {
 	struct stat	st;
 	size_t		lineno;
@@ -786,6 +806,10 @@
 	FILE		*fp;
 	char		*cp;
 	char		*s;
+	user_t		*up = dp-user;
+	group_t		*gp = dp-group;
+
+	(void)memset(dp, 0, sizeof(*dp));
 
 	memsave(up-u_primgrp, DEF_GROUP, strlen(DEF_GROUP));
 	memsave(up-u_basedir, DEF_BASEDIR, strlen(DEF_BASEDIR));
@@ -800,6 +824,9 @@
 	NEWARRAY(range_t, up-u_rv, up-u_rsize, exit(1));
 	up-u_inactive = DEF_INACTIVE;
 	up-u_expire = DEF_EXPIRE;
+	gp-g_rsize = 16;
+	gp-g_defrc = 0;
+	NEWARRAY(range_t, gp-g_rv, gp-g_rsize, exit(1));
 	if ((fp = fopen(_PATH_USERMGMT_CONF, r)) == NULL) {
 		

CVS commit: src/sys/nfs

2009-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 31 20:01:33 UTC 2009

Modified Files:
src/sys/nfs: nfs_subs.c nfs_syscalls.c

Log Message:
put nuidhash_max in a file that is shared between server and client code.


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/nfs/nfs_subs.c
cvs rdiff -u -r1.152 -r1.153 src/sys/nfs/nfs_syscalls.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_subs.c
diff -u src/sys/nfs/nfs_subs.c:1.217 src/sys/nfs/nfs_subs.c:1.218
--- src/sys/nfs/nfs_subs.c:1.217	Thu May 14 11:42:22 2009
+++ src/sys/nfs/nfs_subs.c	Thu Dec 31 15:01:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_subs.c,v 1.217 2009/05/14 15:42:22 yamt Exp $	*/
+/*	$NetBSD: nfs_subs.c,v 1.218 2009/12/31 20:01:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_subs.c,v 1.217 2009/05/14 15:42:22 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_subs.c,v 1.218 2009/12/31 20:01:33 christos Exp $);
 
 #ifdef _KERNEL_OPT
 #include fs_nfs.h
@@ -118,6 +118,7 @@
 
 static u_int32_t nfs_xid;
 
+int nuidhash_max = NFS_MAXUIDHASH;
 /*
  * Data items converted to xdr at startup, since they are constant
  * This is kinda hokey, but may save a little time doing byte swaps

Index: src/sys/nfs/nfs_syscalls.c
diff -u src/sys/nfs/nfs_syscalls.c:1.152 src/sys/nfs/nfs_syscalls.c:1.153
--- src/sys/nfs/nfs_syscalls.c:1.152	Thu Dec 31 14:38:16 2009
+++ src/sys/nfs/nfs_syscalls.c	Thu Dec 31 15:01:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_syscalls.c,v 1.152 2009/12/31 19:38:16 christos Exp $	*/
+/*	$NetBSD: nfs_syscalls.c,v 1.153 2009/12/31 20:01:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_syscalls.c,v 1.152 2009/12/31 19:38:16 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_syscalls.c,v 1.153 2009/12/31 20:01:33 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -79,7 +79,7 @@
 		struct nfssvc_sock *,
 		struct lwp *, struct mbuf **);
 extern int nfsrvw_procrastinate;
-int nuidhash_max = NFS_MAXUIDHASH;
+extern int nuidhash_max;
 
 static int nfs_numnfsd = 0;
 static struct nfsdrt nfsdrt;



CVS commit: src/usr.sbin/user

2009-12-31 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Dec 31 20:14:19 UTC 2009

Modified Files:
src/usr.sbin/user: usermgmt.conf.5

Log Message:
Bump date for gid_range.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/user/usermgmt.conf.5

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/user/usermgmt.conf.5
diff -u src/usr.sbin/user/usermgmt.conf.5:1.6 src/usr.sbin/user/usermgmt.conf.5:1.7
--- src/usr.sbin/user/usermgmt.conf.5:1.6	Thu Dec 31 19:59:31 2009
+++ src/usr.sbin/user/usermgmt.conf.5	Thu Dec 31 20:14:19 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: usermgmt.conf.5,v 1.6 2009/12/31 19:59:31 mlelstv Exp $
+.\ $NetBSD: usermgmt.conf.5,v 1.7 2009/12/31 20:14:19 wiz Exp $
 .\
 .\ Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -29,7 +29,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd July 18, 2008
+.Dd December 31, 2009
 .Dt USERMGMT.CONF 5
 .Os
 .\ turn off hyphenation



CVS commit: src/doc

2009-12-31 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Dec 31 22:54:40 UTC 2009

Modified Files:
src/doc: CHANGES

Log Message:
mention tzcode update


To generate a diff of this commit:
cvs rdiff -u -r1.1338 -r1.1339 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1338 src/doc/CHANGES:1.1339
--- src/doc/CHANGES:1.1338	Tue Dec 29 17:26:50 2009
+++ src/doc/CHANGES	Thu Dec 31 22:54:40 2009
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1338 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1339 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -512,3 +512,4 @@
 	gfb: Add a driver for Sun XVR-1000 graphics boards
 		[macallan 20091229]
 	wm(4): Add support for i82583V	[msaitoh 20091230]
+	libc: Import tzcode2009k [mlelstv 20091231]



CVS commit: src/sys/conf

2009-12-31 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Thu Dec 31 23:59:02 UTC 2009

Modified Files:
src/sys/conf: copyright

Log Message:
Welcome to 2010.

Don't forget to update copyright notices when you add new code.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/conf/copyright

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

Modified files:

Index: src/sys/conf/copyright
diff -u src/sys/conf/copyright:1.6 src/sys/conf/copyright:1.7
--- src/sys/conf/copyright:1.6	Thu Jan  1 00:00:01 2009
+++ src/sys/conf/copyright	Thu Dec 31 23:59:02 2009
@@ -1,5 +1,5 @@
 Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007, 2008, 2009
+2006, 2007, 2008, 2009, 2010
 The NetBSD Foundation, Inc.  All rights reserved.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
 The Regents of the University of California.  All rights reserved.



CVS commit: src/games/fortune/datfiles

2009-12-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Jan  1 00:16:54 UTC 2010

Modified Files:
src/games/fortune/datfiles: fortunes2

Log Message:
Fix math notation, from PR 41547. While here, fix some potential tab
damage in the same fortune.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/games/fortune/datfiles/fortunes2

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

Modified files:

Index: src/games/fortune/datfiles/fortunes2
diff -u src/games/fortune/datfiles/fortunes2:1.40 src/games/fortune/datfiles/fortunes2:1.41
--- src/games/fortune/datfiles/fortunes2:1.40	Tue Dec  8 10:13:39 2009
+++ src/games/fortune/datfiles/fortunes2	Fri Jan  1 00:16:54 2010
@@ -519,9 +519,10 @@
 %
 	... with liberty and justice for all who can afford it.
 %
-	12 + 144 + 20 + 3(4)  2
+	   ___
+	12 + 144 + 20 + 3\/ 4 2
 	--  +  5(11)  =  9  +  0
-		  7
+	  7
 
 A dozen, a gross and a score,
 Plus three times the square root of four,



CVS commit: src/sys/arch/arm/arm32

2009-12-31 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Jan  1 02:32:29 UTC 2010

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Sprinkle assertions after calling pmap_get_l2_bucket().


To generate a diff of this commit:
cvs rdiff -u -r1.209 -r1.210 src/sys/arch/arm/arm32/pmap.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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.209 src/sys/arch/arm/arm32/pmap.c:1.210
--- src/sys/arch/arm/arm32/pmap.c:1.209	Thu Dec 31 18:34:56 2009
+++ src/sys/arch/arm/arm32/pmap.c	Fri Jan  1 02:32:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.209 2009/12/31 18:34:56 uebayasi Exp $	*/
+/*	$NetBSD: pmap.c,v 1.210 2010/01/01 02:32:28 uebayasi Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -211,7 +211,7 @@
 #include machine/param.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.209 2009/12/31 18:34:56 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.210 2010/01/01 02:32:28 uebayasi Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -1531,6 +1531,7 @@
 
 		pm-pm_pl1vec = pm-pm_l1-l1_kva[L1_IDX(vector_page)];
 		l2b = pmap_get_l2_bucket(pm, vector_page);
+		KDASSERT(l2b != NULL);
 		pm-pm_l1vec = l2b-l2b_phys | L1_C_PROTO |
 		L1_C_DOM(pm-pm_domain);
 	} else
@@ -1752,6 +1753,7 @@
 			pv-pv_flags |= PVF_NC;
 
 			l2b = pmap_get_l2_bucket(pv-pv_pmap, pv-pv_va);
+			KDASSERT(l2b != NULL);
 			ptep = l2b-l2b_kva[l2pte_index(pv-pv_va)];
 			pte = *ptep  ~L2_S_CACHE_MASK;
 
@@ -1794,6 +1796,7 @@
 			pv-pv_flags = ~PVF_NC;
 
 			l2b = pmap_get_l2_bucket(pv-pv_pmap, pv-pv_va);
+			KDASSERT(l2b != NULL);
 			ptep = l2b-l2b_kva[l2pte_index(pv-pv_va)];
 			pte = (*ptep  ~L2_S_CACHE_MASK) | pte_l2_s_cache_mode;
 
@@ -2082,6 +2085,7 @@
 	 */
 	SLIST_FOREACH(pv, pg-mdpage.pvh_list, pv_link) {
 		l2b = pmap_get_l2_bucket(pv-pv_pmap, pv-pv_va);
+		KDASSERT(l2b != NULL);
 		ptep = l2b-l2b_kva[l2pte_index(pv-pv_va)];
 		opte = *ptep;
 		pte = opte  ~L2_S_CACHE_MASK;
@@ -5231,6 +5235,7 @@
 	if (vector_page  KERNEL_BASE) {
 		pm-pm_pl1vec = pm-pm_l1-l1_kva[L1_IDX(vector_page)];
 		l2b = pmap_get_l2_bucket(pm, vector_page);
+		KDASSERT(l2b != NULL);
 		pm-pm_l1vec = l2b-l2b_phys | L1_C_PROTO |
 		L1_C_DOM(pm-pm_domain);
 	} else
@@ -5459,6 +5464,7 @@
 			 * with the cache-mode set to write-through.
 			 */
 			l2b = pmap_get_l2_bucket(pmap_kernel(), va);
+			KDASSERT(l2b != NULL);
 			ptep = l2b-l2b_kva[l2pte_index(va)];
 			pte = *ptep;
 			pte = (pte  ~L2_S_CACHE_MASK) | pte_l2_s_cache_mode_pt;



CVS commit: src/sys/arch/i386/stand/bootxx

2009-12-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  1 03:18:27 UTC 2010

Modified Files:
src/sys/arch/i386/stand/bootxx: boot1.c

Log Message:
If the open fails, don't call fstat, because this changes the errno to EINVAL
from eg. ENOENT.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/bootxx/boot1.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/i386/stand/bootxx/boot1.c
diff -u src/sys/arch/i386/stand/bootxx/boot1.c:1.18 src/sys/arch/i386/stand/bootxx/boot1.c:1.19
--- src/sys/arch/i386/stand/bootxx/boot1.c:1.18	Wed Nov 18 16:02:16 2009
+++ src/sys/arch/i386/stand/bootxx/boot1.c	Thu Dec 31 22:18:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot1.c,v 1.18 2009/11/18 21:02:16 dsl Exp $	*/
+/*	$NetBSD: boot1.c,v 1.19 2010/01/01 03:18:27 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: boot1.c,v 1.18 2009/11/18 21:02:16 dsl Exp $);
+__RCSID($NetBSD: boot1.c,v 1.19 2010/01/01 03:18:27 christos Exp $);
 
 #include lib/libsa/stand.h
 #include lib/libkern/libkern.h
@@ -107,9 +107,8 @@
 
 done:
 	/* if we fail here, so will fstat, so keep going */
-	if (fstat(fd, sb) == -1) {
+	if (fd == -1 || fstat(fd, sb) == -1)
 		return Can't open /boot\r\n;
-	}
 
 	biosdev = (uint32_t)sb.st_size;
 #if 0



CVS commit: src/sys/kern

2009-12-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Jan  1 03:22:13 UTC 2010

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

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/kern/kern_module.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/kern_module.c
diff -u src/sys/kern/kern_module.c:1.55 src/sys/kern/kern_module.c:1.56
--- src/sys/kern/kern_module.c:1.55	Tue Dec 29 17:49:21 2009
+++ src/sys/kern/kern_module.c	Fri Jan  1 03:22:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.55 2009/12/29 17:49:21 elad Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.56 2010/01/01 03:22:13 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_module.c,v 1.55 2009/12/29 17:49:21 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_module.c,v 1.56 2010/01/01 03:22:13 dholland Exp $);
 
 #define _MODULE_INTERNAL
 
@@ -344,7 +344,7 @@
 		return EPERM;
 	}
 
-/* Disallow path seperators and magic symlinks. */
+/* Disallow path separators and magic symlinks. */
 if (strchr(filename, '/') != NULL || strchr(filename, '@') != NULL ||
 strchr(filename, '.') != NULL) {
 	return EPERM;



CVS commit: [matt-nb5-mips64] src/gnu/dist/binutils/gas

2009-12-31 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  1 06:02:50 UTC 2010

Modified Files:
src/gnu/dist/binutils/gas [matt-nb5-mips64]: write.c

Log Message:
Only allow merging with a symbol + offset if that offset = 0


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3.32.2 -r1.1.1.3.32.3 src/gnu/dist/binutils/gas/write.c

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

Modified files:

Index: src/gnu/dist/binutils/gas/write.c
diff -u src/gnu/dist/binutils/gas/write.c:1.1.1.3.32.2 src/gnu/dist/binutils/gas/write.c:1.1.1.3.32.3
--- src/gnu/dist/binutils/gas/write.c:1.1.1.3.32.2	Wed Aug 26 12:33:54 2009
+++ src/gnu/dist/binutils/gas/write.c	Fri Jan  1 06:02:50 2010
@@ -851,7 +851,8 @@
 	   a non-zero addend if the addend would place the relocation outside
 	   the section's limits.  */
 	if ((symsec-flags  SEC_MERGE) != 0
-	 (S_GET_VALUE(sym) + fixp-fx_offset = bfd_get_section_size(symsec)
+	 (fixp-fx_offset  0
+		|| S_GET_VALUE(sym) + fixp-fx_offset = bfd_get_section_size(symsec)
 		|| S_GET_VALUE(sym) + fixp-fx_offset  0
 	|| fixp-fx_subsy != NULL))
 	  continue;



CVS commit: src/external/gpl3/binutils/dist/gas

2009-12-31 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  1 06:12:55 UTC 2010

Modified Files:
src/external/gpl3/binutils/dist/gas: write.c

Log Message:
Don't allow a symbol + offset in a merge section to translated to a
.section + offset reference if offset is negative.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/binutils/dist/gas/write.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/gpl3/binutils/dist/gas/write.c
diff -u src/external/gpl3/binutils/dist/gas/write.c:1.2 src/external/gpl3/binutils/dist/gas/write.c:1.3
--- src/external/gpl3/binutils/dist/gas/write.c:1.2	Sun Nov 15 10:25:16 2009
+++ src/external/gpl3/binutils/dist/gas/write.c	Fri Jan  1 06:12:55 2010
@@ -822,10 +822,11 @@
 	  }
 
 	/* Never adjust a reloc against local symbol in a merge section with
-	   a non-zero addend if the addend would place the relocation otside
-	   the section's limits.  */
+	   a non-negative addend or if the addend would place the relocation
+	   outside the section's limits.  */
 	if ((symsec-flags  SEC_MERGE) != 0
-	 (S_GET_VALUE(sym) + fixp-fx_offset = bfd_get_section_size(symsec)
+	 (S_GET_VALUE(sym) + fixp-fx_offset  S_GET_VALUE(sym)
+		|| S_GET_VALUE(sym) + fixp-fx_offset = bfd_get_section_size(symsec)
 	|| fixp-fx_subsy != NULL))
 	  continue;
 



CVS commit: src/games/canfield/cfscores

2009-12-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Jan  1 06:16:36 UTC 2010

Modified Files:
src/games/canfield/cfscores: cfscores.c

Log Message:
Correct usage message.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/games/canfield/cfscores/cfscores.c

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

Modified files:

Index: src/games/canfield/cfscores/cfscores.c
diff -u src/games/canfield/cfscores/cfscores.c:1.16 src/games/canfield/cfscores/cfscores.c:1.17
--- src/games/canfield/cfscores/cfscores.c:1.16	Wed Aug 12 05:35:44 2009
+++ src/games/canfield/cfscores/cfscores.c	Fri Jan  1 06:16:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cfscores.c,v 1.16 2009/08/12 05:35:44 dholland Exp $	*/
+/*	$NetBSD: cfscores.c,v 1.17 2010/01/01 06:16:36 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)cfscores.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: cfscores.c,v 1.16 2009/08/12 05:35:44 dholland Exp $);
+__RCSID($NetBSD: cfscores.c,v 1.17 2010/01/01 06:16:36 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -78,7 +78,7 @@
 	setgid(getgid());
 
 	if (argc  2) {
-		printf(Usage: cfscores [user]\n);
+		printf(Usage: cfscores -a | cfscores [user]\n);
 		exit(1);
 	}
 	dbfd = open(_PATH_SCORE, O_RDONLY);



CVS commit: src/games/canfield/cfscores

2009-12-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Jan  1 06:20:45 UTC 2010

Modified Files:
src/games/canfield/cfscores: cfscores.c

Log Message:
Send error messages to stderr. Use errx/warnx, not printf.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/games/canfield/cfscores/cfscores.c

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

Modified files:

Index: src/games/canfield/cfscores/cfscores.c
diff -u src/games/canfield/cfscores/cfscores.c:1.17 src/games/canfield/cfscores/cfscores.c:1.18
--- src/games/canfield/cfscores/cfscores.c:1.17	Fri Jan  1 06:16:36 2010
+++ src/games/canfield/cfscores/cfscores.c	Fri Jan  1 06:20:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cfscores.c,v 1.17 2010/01/01 06:16:36 dholland Exp $	*/
+/*	$NetBSD: cfscores.c,v 1.18 2010/01/01 06:20:45 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)cfscores.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: cfscores.c,v 1.17 2010/01/01 06:16:36 dholland Exp $);
+__RCSID($NetBSD: cfscores.c,v 1.18 2010/01/01 06:20:45 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -78,8 +78,7 @@
 	setgid(getgid());
 
 	if (argc  2) {
-		printf(Usage: cfscores -a | cfscores [user]\n);
-		exit(1);
+		errx(1, Usage: cfscores -a | cfscores [user]);
 	}
 	dbfd = open(_PATH_SCORE, O_RDONLY);
 	if (dbfd  0)
@@ -89,8 +88,7 @@
 		uid = getuid();
 		pw = getpwuid(uid);
 		if (pw == 0) {
-			printf(You are not listed in the password file?!?\n);
-			exit(2);
+			errx(2, You are not listed in the password file?!?);
 		}
 		printuser(pw, 1);
 		exit(0);
@@ -102,8 +100,7 @@
 	}
 	pw = getpwnam(argv[1]);
 	if (pw == 0) {
-		printf(User %s unknown\n, argv[1]);
-		exit(3);
+		errx(3, User %s unknown, argv[1]);
 	}
 	printuser(pw, 1);
 	exit(0);
@@ -122,7 +119,7 @@
 	pos = pw-pw_uid * (off_t)sizeof(struct betinfo);
 	/* test pos, not pw_uid; uid_t can be unsigned, which makes gcc warn */
 	if (pos  0) {
-		printf(Bad uid %d\n, (int)pw-pw_uid);
+		warnx(Bad uid %d, (int)pw-pw_uid);
 		return;
 	}
 	i = lseek(dbfd, pos, SEEK_SET);



CVS commit: src/games/canfield/cfscores

2009-12-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Jan  1 06:31:18 UTC 2010

Modified Files:
src/games/canfield/cfscores: cfscores.c

Log Message:
Use NULL instead of 0 for pointer tests. Remove an unnecessary cast.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/games/canfield/cfscores/cfscores.c

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

Modified files:

Index: src/games/canfield/cfscores/cfscores.c
diff -u src/games/canfield/cfscores/cfscores.c:1.18 src/games/canfield/cfscores/cfscores.c:1.19
--- src/games/canfield/cfscores/cfscores.c:1.18	Fri Jan  1 06:20:45 2010
+++ src/games/canfield/cfscores/cfscores.c	Fri Jan  1 06:31:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cfscores.c,v 1.18 2010/01/01 06:20:45 dholland Exp $	*/
+/*	$NetBSD: cfscores.c,v 1.19 2010/01/01 06:31:18 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)cfscores.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: cfscores.c,v 1.18 2010/01/01 06:20:45 dholland Exp $);
+__RCSID($NetBSD: cfscores.c,v 1.19 2010/01/01 06:31:18 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -87,19 +87,19 @@
 	if (argc == 1) {
 		uid = getuid();
 		pw = getpwuid(uid);
-		if (pw == 0) {
+		if (pw == NULL) {
 			errx(2, You are not listed in the password file?!?);
 		}
 		printuser(pw, 1);
 		exit(0);
 	}
 	if (strcmp(argv[1], -a) == 0) {
-		while ((pw = getpwent()) != 0)
+		while ((pw = getpwent()) != NULL)
 			printuser(pw, 0);
 		exit(0);
 	}
 	pw = getpwnam(argv[1]);
-	if (pw == 0) {
+	if (pw == NULL) {
 		errx(3, User %s unknown, argv[1]);
 	}
 	printuser(pw, 1);
@@ -125,7 +125,7 @@
 	i = lseek(dbfd, pos, SEEK_SET);
 	if (i  0)
 		warn(lseek %s, _PATH_SCORE);
-	i = read(dbfd, (char *)total, sizeof(total));
+	i = read(dbfd, total, sizeof(total));
 	if (i  0)
 		warn(read %s, _PATH_SCORE);
 	if (i == 0 || total.hand == 0) {



CVS commit: src/games/canfield

2009-12-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Jan  1 06:37:16 UTC 2010

Modified Files:
src/games/canfield/canfield: canfield.c
src/games/canfield/cfscores: cfscores.c
Added Files:
src/games/canfield/canfield: betinfo.h

Log Message:
Split struct betinfo into its own header file so it can be shared
between canfield and cfscores, instead of copy-pasted.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/games/canfield/canfield/betinfo.h
cvs rdiff -u -r1.26 -r1.27 src/games/canfield/canfield/canfield.c
cvs rdiff -u -r1.19 -r1.20 src/games/canfield/cfscores/cfscores.c

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

Modified files:

Index: src/games/canfield/canfield/canfield.c
diff -u src/games/canfield/canfield/canfield.c:1.26 src/games/canfield/canfield/canfield.c:1.27
--- src/games/canfield/canfield/canfield.c:1.26	Wed Aug 12 05:35:44 2009
+++ src/games/canfield/canfield/canfield.c	Fri Jan  1 06:37:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: canfield.c,v 1.26 2009/08/12 05:35:44 dholland Exp $	*/
+/*	$NetBSD: canfield.c,v 1.27 2010/01/01 06:37:15 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)canfield.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: canfield.c,v 1.26 2009/08/12 05:35:44 dholland Exp $);
+__RCSID($NetBSD: canfield.c,v 1.27 2010/01/01 06:37:15 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -66,6 +66,7 @@
 #include time.h
 #include unistd.h
 
+#include betinfo.h
 #include pathnames.h
 
 #define	decksize	52
@@ -183,16 +184,6 @@
 /*
  * Variables associated with betting 
  */
-struct betinfo {
-	long	hand;		/* cost of dealing hand */
-	long	inspection;	/* cost of inspecting hand */
-	long	game;		/* cost of buying game */
-	long	runs;		/* cost of running through hands */
-	long	information;	/* cost of information */
-	long	thinktime;	/* cost of thinking time */
-	long	wins;		/* total winnings */
-	long	worth;		/* net worth after costs */
-};
 static struct betinfo this, game, total;
 static bool startedgame = FALSE, infullgame = FALSE;
 static time_t acctstart;

Index: src/games/canfield/cfscores/cfscores.c
diff -u src/games/canfield/cfscores/cfscores.c:1.19 src/games/canfield/cfscores/cfscores.c:1.20
--- src/games/canfield/cfscores/cfscores.c:1.19	Fri Jan  1 06:31:18 2010
+++ src/games/canfield/cfscores/cfscores.c	Fri Jan  1 06:37:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cfscores.c,v 1.19 2010/01/01 06:31:18 dholland Exp $	*/
+/*	$NetBSD: cfscores.c,v 1.20 2010/01/01 06:37:16 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)cfscores.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: cfscores.c,v 1.19 2010/01/01 06:31:18 dholland Exp $);
+__RCSID($NetBSD: cfscores.c,v 1.20 2010/01/01 06:37:16 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -51,19 +51,9 @@
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include betinfo.h
 #include pathnames.h
 
-struct betinfo {
-	long	hand;		/* cost of dealing hand */
-	long	inspection;	/* cost of inspecting hand */
-	long	game;		/* cost of buying game */
-	long	runs;		/* cost of running through hands */
-	long	information;	/* cost of information */
-	long	thinktime;	/* cost of thinking time */
-	long	wins;		/* total winnings */
-	long	worth;		/* net worth after costs */
-};
-
 static int dbfd;
 
 static void printuser(const struct passwd *, int);

Added files:

Index: src/games/canfield/canfield/betinfo.h
diff -u /dev/null src/games/canfield/canfield/betinfo.h:1.1
--- /dev/null	Fri Jan  1 06:37:16 2010
+++ src/games/canfield/canfield/betinfo.h	Fri Jan  1 06:37:15 2010
@@ -0,0 +1,44 @@
+/*	$NetBSD: betinfo.h,v 1.1 2010/01/01 06:37:15 dholland Exp $	*/
+
+/*
+ * Copyright (c) 1983, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, 

CVS commit: src/games/canfield/canfield

2009-12-31 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Jan  1 07:35:09 UTC 2010

Modified Files:
src/games/canfield/canfield: canfield.6

Log Message:
Adjust SYNOPSIS for cfscores to better match reality. Note in BUGS
that the score file isn't portable. Bump date (first time since 1993,
and first in 2010...)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/canfield/canfield/canfield.6

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

Modified files:

Index: src/games/canfield/canfield/canfield.6
diff -u src/games/canfield/canfield/canfield.6:1.10 src/games/canfield/canfield/canfield.6:1.11
--- src/games/canfield/canfield/canfield.6:1.10	Thu Sep 15 02:09:41 2005
+++ src/games/canfield/canfield/canfield.6	Fri Jan  1 07:35:09 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: canfield.6,v 1.10 2005/09/15 02:09:41 wiz Exp $
+.\	$NetBSD: canfield.6,v 1.11 2010/01/01 07:35:09 dholland Exp $
 .\
 .\ Copyright (c) 1983, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	@(#)canfield.6	8.1 (Berkeley) 5/31/93
 .\
-.Dd May 31, 1993
+.Dd January 1, 2010
 .Dt CANFIELD 6
 .Os
 .Sh NAME
@@ -39,8 +39,9 @@
 .Sh SYNOPSIS
 .Nm
 .Nm cfscores
-.Op Fl a
 .Op Ar user
+.Nm cfscores
+.Fl a
 .Sh DESCRIPTION
 If you have never played solitaire before, it is recommended
 that you consult a solitaire instruction book. In
@@ -120,3 +121,5 @@
 Mikey Olson, and Eric Allman.
 .Sh BUGS
 It is impossible to cheat.
+.Pp
+The score file database is not portable.