CVS commit: xsrc/external/mit/xf86-input-keyboard/dist/src

2011-04-18 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Mon Apr 18 23:31:06 UTC 2011

Modified Files:
xsrc/external/mit/xf86-input-keyboard/dist/src: bsd_KbdMap.c

Log Message:
add a couple mappings for keys found on Sun keyboards


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c

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

Modified files:

Index: xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c
diff -u xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.4 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.5
--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c:1.4	Mon Nov 22 07:29:09 2010
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c	Mon Apr 18 23:31:06 2011
@@ -404,34 +404,34 @@
 	/* 99 */ KEY_KP_Decimal,	/* Keypad . Del */
 	/* 100 */ KEY_Less,	/* < > on some keyboards */
 	/* 101 */ KEY_Menu,	/* Menu */
-	/* 102 */ KEY_NOTUSED,
+	/* 102 */ KEY_Power,	/* sleep key on Sun USB */
 	/* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */
-	/* 104 */ KEY_NOTUSED,
-	/* 105 */ KEY_NOTUSED,
-	/* 106 */ KEY_NOTUSED,
-	/* 107 */ KEY_NOTUSED,
+	/* 104 */ KEY_F13,
+	/* 105 */ KEY_F14,
+	/* 106 */ KEY_F15,
+	/* 107 */ KEY_F16,
 	/* 108 */ KEY_NOTUSED,
-	/* 109 */ KEY_NOTUSED,
+	/* 109 */ KEY_Power,
 	/* 110 */ KEY_NOTUSED,
 	/* 111 */ KEY_NOTUSED,
 	/* 112 */ KEY_NOTUSED,
 	/* 113 */ KEY_NOTUSED,
 	/* 114 */ KEY_NOTUSED,
 	/* 115 */ KEY_NOTUSED,
-	/* 116 */ KEY_NOTUSED,
-	/* 117 */ KEY_NOTUSED,
-	/* 118 */ KEY_NOTUSED,
-	/* 119 */ KEY_NOTUSED,
-	/* 120 */ KEY_NOTUSED,
-	/* 121 */ KEY_NOTUSED,
-	/* 122 */ KEY_NOTUSED,
-	/* 123 */ KEY_NOTUSED,
-	/* 124 */ KEY_NOTUSED,
-	/* 125 */ KEY_NOTUSED,
-	/* 126 */ KEY_NOTUSED,
-	/* 127 */ KEY_NOTUSED,
-	/* 128 */ KEY_NOTUSED,
-	/* 129 */ KEY_NOTUSED,
+	/* 116 */ KEY_L7,
+	/* 117 */ KEY_Help,
+	/* 118 */ KEY_L3,
+	/* 119 */ KEY_L5,
+	/* 120 */ KEY_L1,
+	/* 121 */ KEY_L2,
+	/* 122 */ KEY_L4,
+	/* 123 */ KEY_L10,
+	/* 124 */ KEY_L6,
+	/* 125 */ KEY_L8,
+	/* 126 */ KEY_L9,
+	/* 127 */ KEY_Mute,
+	/* 128 */ KEY_AudioRaise,
+	/* 129 */ KEY_AudioLower,
 	/* 130 */ KEY_NOTUSED,
 	/* 131 */ KEY_NOTUSED,
 	/* 132 */ KEY_NOTUSED,



CVS commit: xsrc/external/mit/xf86-input-keyboard/dist/src

2011-04-18 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Mon Apr 18 23:30:11 UTC 2011

Modified Files:
xsrc/external/mit/xf86-input-keyboard/dist/src: bsd_kbd.c kbd.c

Log Message:
be less braindead about the Device option - only default to /dev/wskbd if
Protocol is set to wskbd. Now Protocol "standard" should work again.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c

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

Modified files:

Index: xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c
diff -u xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.11 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.12
--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.11	Mon Nov 22 07:29:09 2010
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c	Mon Apr 18 23:30:11 2011
@@ -383,20 +383,18 @@
 xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, s);
 xfree(s);
 
-s = xf86SetStrOption(pInfo->options, "Device", NULL);
+if (prot == PROT_WSCONS) {
+	s = xf86SetStrOption(pInfo->options, "Device", "/dev/wskbd");
+} else
+	s = xf86SetStrOption(pInfo->options, "Device", NULL);
+
 if (s == NULL) {
-   if (prot == PROT_WSCONS) {
-   xf86Msg(X_ERROR,"A \"device\" option is required with"
-  " the \"wskbd\" keyboard protocol\n");
-   return FALSE;
-   } else {
-   pInfo->fd = xf86Info.consoleFd;
-   pKbd->isConsole = TRUE;
-   pKbd->consType = xf86Info.consType;
-   }
+	pInfo->fd = xf86Info.consoleFd;
+	pKbd->isConsole = TRUE;
+	pKbd->consType = xf86Info.consType;
 } else {
 	pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
-   if (pInfo->fd == -1) {
+	if (pInfo->fd == -1) {
xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
xfree(s);
return FALSE;

Index: xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c
diff -u xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c:1.2 xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c:1.3
--- xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c:1.2	Wed Apr 13 16:23:29 2011
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c	Mon Apr 18 23:30:11 2011
@@ -80,7 +80,6 @@
 static const char *kbdDefaults[] = {
 #ifdef __NetBSD__
 "Protocol",		"wskbd",
-"Device",		"/dev/wskbd",
 #else /* NetBSD */
 #ifdef XQUEUE 
 "Protocol",		"Xqueue",



CVS commit: src/usr.bin/grep

2011-04-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 18 23:22:42 UTC 2011

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

Log Message:
Avoid C99 features.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/grep/grep.c
cvs rdiff -u -r1.12 -r1.13 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/grep.c
diff -u src/usr.bin/grep/grep.c:1.8 src/usr.bin/grep/grep.c:1.9
--- src/usr.bin/grep/grep.c:1.8	Mon Apr 18 22:46:48 2011
+++ src/usr.bin/grep/grep.c	Mon Apr 18 23:22:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.8 2011/04/18 22:46:48 joerg Exp $	*/
+/*	$NetBSD: grep.c,v 1.9 2011/04/18 23:22:42 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 
-__RCSID("$NetBSD: grep.c,v 1.8 2011/04/18 22:46:48 joerg Exp $");
+__RCSID("$NetBSD: grep.c,v 1.9 2011/04/18 23:22:42 joerg Exp $");
 
 #include 
 #include 
@@ -323,7 +323,7 @@
 	char **aargv, **eargv, *eopts;
 	char *ep;
 	unsigned long long l;
-	unsigned int aargc, eargc, i;
+	unsigned int aargc, eargc, i, j;
 	int c, lastc, needpattern, newarg, prevoptind;
 
 	setlocale(LC_ALL, "");
@@ -374,7 +374,7 @@
 		char *str;
 
 		/* make an estimation of how many extra arguments we have */
-		for (unsigned int j = 0; j < strlen(eopts); j++)
+		for (j = 0; j < strlen(eopts); j++)
 			if (eopts[j] == ' ')
 eargc++;
 
@@ -391,7 +391,7 @@
 		aargv[0] = argv[0];
 		for (i = 0; i < eargc; i++)
 			aargv[i + 1] = eargv[i];
-		for (int j = 1; j < argc; j++, i++)
+		for (j = 1; j < (unsigned int)argc; j++, i++)
 			aargv[i + 1] = argv[j];
 
 		aargc = eargc + argc;

Index: src/usr.bin/grep/util.c
diff -u src/usr.bin/grep/util.c:1.12 src/usr.bin/grep/util.c:1.13
--- src/usr.bin/grep/util.c:1.12	Mon Apr 18 22:46:48 2011
+++ src/usr.bin/grep/util.c	Mon Apr 18 23:22:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.12 2011/04/18 22:46:48 joerg Exp $	*/
+/*	$NetBSD: util.c,v 1.13 2011/04/18 23:22:42 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 $	*/
 
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: util.c,v 1.12 2011/04/18 22:46:48 joerg Exp $");
+__RCSID("$NetBSD: util.c,v 1.13 2011/04/18 23:22:42 joerg Exp $");
 
 #include 
 #include 
@@ -64,13 +64,14 @@
 file_matching(const char *fname)
 {
 	char *fname_base, *fname_copy;
+	unsigned int i;
 	bool ret;
 
 	ret = finclude ? false : true;
 	fname_copy = grep_strdup(fname);
 	fname_base = basename(fname_copy);
 
-	for (unsigned int i = 0; i < fpatterns; ++i) {
+	for (i = 0; i < fpatterns; ++i) {
 		if (fnmatch(fpattern[i].pat, fname, 0) == 0 ||
 		fnmatch(fpattern[i].pat, fname_base, 0) == 0) {
 			if (fpattern[i].mode == EXCL_PAT)
@@ -86,11 +87,12 @@
 static inline bool
 dir_matching(const char *dname)
 {
+	unsigned int i;
 	bool ret;
 
 	ret = dinclude ? false : true;
 
-	for (unsigned int i = 0; i < dpatterns; ++i) {
+	for (i = 0; i < dpatterns; ++i) {
 		if (dname != NULL &&
 		fnmatch(dname, dpattern[i].pat, 0) == 0) {
 			if (dpattern[i].mode == EXCL_PAT)



CVS commit: src/usr.bin/grep

2011-04-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Apr 18 22:46:49 UTC 2011

Modified Files:
src/usr.bin/grep: file.c grep.1 grep.c grep.h util.c
src/usr.bin/grep/nls: C.msg es_ES.ISO8859-1.msg gl_ES.ISO8859-1.msg
hu_HU.ISO8859-2.msg ja_JP.SJIS.msg ja_JP.UTF-8.msg ja_JP.eucJP.msg
pt_BR.ISO8859-1.msg ru_RU.KOI8-R.msg uk_UA.UTF-8.msg
zh_CN.UTF-8.msg

Log Message:
Add support for --null-data. Change -Z to behave like GNU grep's -Z.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/grep/file.c src/usr.bin/grep/grep.h
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/grep/grep.1
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/grep/grep.c
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/grep/util.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/grep/nls/C.msg \
src/usr.bin/grep/nls/es_ES.ISO8859-1.msg \
src/usr.bin/grep/nls/gl_ES.ISO8859-1.msg \
src/usr.bin/grep/nls/hu_HU.ISO8859-2.msg \
src/usr.bin/grep/nls/ja_JP.SJIS.msg src/usr.bin/grep/nls/ja_JP.UTF-8.msg \
src/usr.bin/grep/nls/ja_JP.eucJP.msg \
src/usr.bin/grep/nls/pt_BR.ISO8859-1.msg \
src/usr.bin/grep/nls/ru_RU.KOI8-R.msg \
src/usr.bin/grep/nls/uk_UA.UTF-8.msg src/usr.bin/grep/nls/zh_CN.UTF-8.msg

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/file.c
diff -u src/usr.bin/grep/file.c:1.6 src/usr.bin/grep/file.c:1.7
--- src/usr.bin/grep/file.c:1.6	Mon Apr 18 03:27:40 2011
+++ src/usr.bin/grep/file.c	Mon Apr 18 22:46:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.6 2011/04/18 03:27:40 joerg Exp $	*/
+/*	$NetBSD: file.c,v 1.7 2011/04/18 22:46:48 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 $	*/
 
@@ -35,7 +35,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: file.c,v 1.6 2011/04/18 03:27:40 joerg Exp $");
+__RCSID("$NetBSD: file.c,v 1.7 2011/04/18 22:46:48 joerg Exp $");
 
 #include 
 #include 
@@ -147,7 +147,7 @@
 	}
 
 	/* Look for a newline in the remaining part of the buffer */
-	if ((p = memchr(bufpos, '\n', bufrem)) != NULL) {
+	if ((p = memchr(bufpos, line_sep, bufrem)) != NULL) {
 		++p; /* advance over newline */
 		ret = (char *)bufpos;
 		len = p - bufpos;
@@ -169,7 +169,7 @@
 		if (bufrem == 0)
 			/* EOF: return partial line */
 			break;
-		if ((p = memchr(bufpos, '\n', bufrem)) == NULL)
+		if ((p = memchr(bufpos, line_sep, bufrem)) == NULL)
 			continue;
 		/* got it: finish up the line (like code above) */
 		++p;
@@ -207,7 +207,8 @@
 		goto error;
 
 	/* Check for binary stuff, if necessary */
-	if (binbehave != BINFILE_TEXT && memchr(bufpos, '\0', bufrem) != NULL)
+	if (!nulldataflag && binbehave != BINFILE_TEXT &&
+	memchr(bufpos, '\0', bufrem) != NULL)
 		f->binary = true;
 
 	return (f);
Index: src/usr.bin/grep/grep.h
diff -u src/usr.bin/grep/grep.h:1.6 src/usr.bin/grep/grep.h:1.7
--- src/usr.bin/grep/grep.h:1.6	Mon Apr 18 17:18:04 2011
+++ src/usr.bin/grep/grep.h	Mon Apr 18 22:46:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.h,v 1.6 2011/04/18 17:18:04 joerg Exp $	*/
+/*	$NetBSD: grep.h,v 1.7 2011/04/18 22:46:48 joerg Exp $	*/
 /*	$OpenBSD: grep.h,v 1.15 2010/04/05 03:03:55 tedu Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/grep.h 211496 2010-08-19 09:28:59Z des $	*/
 
@@ -113,7 +113,8 @@
 extern bool	 Eflag, Fflag, Gflag, Hflag, Lflag,
 		 bflag, cflag, hflag, iflag, lflag, mflag, nflag, oflag,
 		 qflag, sflag, vflag, wflag, xflag;
-extern bool	 dexclude, dinclude, fexclude, finclude, lbflag, nullflag;
+extern bool	 dexclude, dinclude, fexclude, finclude, lbflag, nullflag, nulldataflag;
+extern unsigned char line_sep;
 extern unsigned long long Aflag, Bflag, mcount;
 extern char	*label;
 extern const char *color;

Index: src/usr.bin/grep/grep.1
diff -u src/usr.bin/grep/grep.1:1.2 src/usr.bin/grep/grep.1:1.3
--- src/usr.bin/grep/grep.1:1.2	Wed Feb 16 01:31:33 2011
+++ src/usr.bin/grep/grep.1	Mon Apr 18 22:46:48 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: grep.1,v 1.2 2011/02/16 01:31:33 joerg Exp $
+.\"	$NetBSD: grep.1,v 1.3 2011/04/18 22:46:48 joerg Exp $
 .\"	$FreeBSD: head/usr.bin/grep/grep.1 210652 2010-07-30 14:05:20Z joel $
 .\"	$OpenBSD: grep.1,v 1.38 2010/04/05 06:30:59 jmc Exp $
 .\" Copyright (c) 1980, 1990, 1993
@@ -30,7 +30,7 @@
 .\"
 .\"	@(#)grep.1	8.3 (Berkeley) 4/18/94
 .\"
-.Dd July 28, 2010
+.Dd April 19, 2011
 .Dt GREP 1
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Sh SYNOPSIS
 .Nm grep
 .Bk -words
-.Op Fl abcdDEFGHhIiJLlmnOopqRSsUVvwxZ
+.Op Fl abcdDEFGHhIiJLlmnOopqRSsUVvwxZz
 .Op Fl A Ar num
 .Op Fl B Ar num
 .Op Fl C Ns Op Ar num
@@ -50,9 +50,9 @@
 .Op Fl Fl color Ns Op = Ns Ar when
 .Op Fl Fl colour Ns Op = Ns Ar when
 .Op Fl Fl context Ns Op = Ns Ar num
+.Op Fl Fl decompress
 .Op Fl Fl label
 .Op Fl Fl line-buffered
-.Op Fl Fl null
 .Op Ar pattern
 .Op Ar
 .Ek
@@ -318,8 +318,6 @@
 .Fl q
 is
 specified.
-.It Fl Fl null
-Prints a zero-byte after the file name.
 .It F

CVS commit: src/sys/dev/pci

2011-04-18 Thread Brian Buhrow
Module Name:src
Committed By:   buhrow
Date:   Mon Apr 18 22:05:39 UTC 2011

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
Fixes for kern/40018.

Our driver initializes the Broadcom hardware to peform a tcp and udp
checksum on only the payload of the tcp or udp packet, rather than the
entire packet.  The FreeBSD, OpenBSD  and Linux drivers instruct the hardware 
to compute
the checksum for the entire packet.  I believe the bug is that some revisions
of the BCM hardware, under certain circumstances, revert to doing the
complete checksum calculation, as the FreeBSD, OpenBSD  and Linux drivers
request, while things are running. As
a result, when we pull the computed checksum from the hardware and pass it
up to the upper layers, we assume the checksum is the more minimal
one, and the upper layers perform the appropriate checks, which, when this
happens, cause the packet to be rejected because the resultant checksum is
decidedly incorrect.
This patch changes the driver to instruct the hardware to perform the
checksum over the entire packet, just as the FreeBSD, OpenBSD  and
Linux drivers do, and to notify the upper layers appropriately.

This patch appears to work on all revisions of the hardware that have been
tested.  (See the list in the bug report.)

this patch is approved by tls.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/dev/pci/if_bge.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/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.193 src/sys/dev/pci/if_bge.c:1.194
--- src/sys/dev/pci/if_bge.c:1.193	Fri Apr  8 17:45:10 2011
+++ src/sys/dev/pci/if_bge.c	Mon Apr 18 22:05:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.193 2011/04/08 17:45:10 sborrill Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.194 2011/04/18 22:05:39 buhrow Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.193 2011/04/08 17:45:10 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.194 2011/04/18 22:05:39 buhrow Exp $");
 
 #include "vlan.h"
 #include "rnd.h"
@@ -1866,7 +1866,7 @@
 	 */
 	CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS |
 	BGE_MODECTL_MAC_ATTN_INTR | BGE_MODECTL_HOST_SEND_BDS |
-	BGE_MODECTL_TX_NO_PHDR_CSUM | BGE_MODECTL_RX_NO_PHDR_CSUM);
+	BGE_MODECTL_TX_NO_PHDR_CSUM);
 
 	/*
 	 * BCM5701 B5 have a bug causing data corruption when using
@@ -3447,7 +3447,7 @@
 			cur_rx->bge_tcp_udp_csum;
 			m->m_pkthdr.csum_flags |=
 			(M_CSUM_TCPv4|M_CSUM_UDPv4|
-			 M_CSUM_DATA|M_CSUM_NO_PSEUDOHDR);
+			 M_CSUM_DATA);
 		}
 
 		/*



CVS commit: src/usr.bin/grep

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

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

Log Message:
Redo context printing so that adjourning contexts don't print the
separator, following GNU grep's behavior in this regard.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/grep/grep.c
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/grep/grep.h
cvs rdiff -u -r1.10 -r1.11 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/grep.c
diff -u src/usr.bin/grep/grep.c:1.6 src/usr.bin/grep/grep.c:1.7
--- src/usr.bin/grep/grep.c:1.6	Mon Apr 18 03:48:23 2011
+++ src/usr.bin/grep/grep.c	Mon Apr 18 17:18:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.6 2011/04/18 03:48:23 joerg Exp $	*/
+/*	$NetBSD: grep.c,v 1.7 2011/04/18 17:18:03 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 
-__RCSID("$NetBSD: grep.c,v 1.6 2011/04/18 03:48:23 joerg Exp $");
+__RCSID("$NetBSD: grep.c,v 1.7 2011/04/18 17:18:03 joerg Exp $");
 
 #include 
 #include 
@@ -147,8 +147,6 @@
 static inline const char	*init_color(const char *);
 
 /* Housekeeping */
-bool	 first = true;	/* flag whether we are processing the first match */
-bool	 prev;		/* flag whether or not the previous line matched */
 int	 tail;		/* lines left to print */
 bool	 notfound;	/* file not found */
 

Index: src/usr.bin/grep/grep.h
diff -u src/usr.bin/grep/grep.h:1.5 src/usr.bin/grep/grep.h:1.6
--- src/usr.bin/grep/grep.h:1.5	Sun Feb 27 17:33:37 2011
+++ src/usr.bin/grep/grep.h	Mon Apr 18 17:18:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.h,v 1.5 2011/02/27 17:33:37 joerg Exp $	*/
+/*	$NetBSD: grep.h,v 1.6 2011/04/18 17:18:04 joerg Exp $	*/
 /*	$OpenBSD: grep.h,v 1.15 2010/04/05 03:03:55 tedu Exp $	*/
 /*	$FreeBSD: head/usr.bin/grep/grep.h 211496 2010-08-19 09:28:59Z des $	*/
 
@@ -119,7 +119,7 @@
 extern const char *color;
 extern int	 binbehave, devbehave, dirbehave, filebehave, grepbehave, linkbehave;
 
-extern bool	 first, matchall, notfound, prev;
+extern bool	 matchall, notfound;
 extern int	 tail;
 extern unsigned int dpatterns, fpatterns, patterns;
 extern char**pattern;

Index: src/usr.bin/grep/util.c
diff -u src/usr.bin/grep/util.c:1.10 src/usr.bin/grep/util.c:1.11
--- src/usr.bin/grep/util.c:1.10	Mon Apr 18 03:27:40 2011
+++ src/usr.bin/grep/util.c	Mon Apr 18 17:18:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.10 2011/04/18 03:27:40 joerg Exp $	*/
+/*	$NetBSD: util.c,v 1.11 2011/04/18 17:18:04 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 $	*/
 
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: util.c,v 1.10 2011/04/18 03:27:40 joerg Exp $");
+__RCSID("$NetBSD: util.c,v 1.11 2011/04/18 17:18:04 joerg Exp $");
 
 #include 
 #include 
@@ -55,7 +55,9 @@
 
 #include "grep.h"
 
-static int	 linesqueued;
+static bool	 first, first_global = true;
+static unsigned long long since_printed;
+
 static int	 procline(struct str *l, int);
 
 bool
@@ -218,11 +220,10 @@
 	strcpy(ln.file, fn);
 	ln.line_no = 0;
 	ln.len = 0;
-	linesqueued = 0;
 	tail = 0;
 	ln.off = -1;
 
-	for (c = 0;  c == 0 || !(lflag || qflag); ) {
+	for (first = true, c = 0;  c == 0 || !(lflag || qflag); ) {
 		ln.off += ln.len + 1;
 		if ((ln.dat = grep_fgetln(f, &ln.len)) == NULL || ln.len == 0) {
 			if (ln.line_no == 0 && matchall)
@@ -242,10 +243,7 @@
 			return (0);
 		}
 		/* Process the file line-by-line */
-		if ((t = procline(&ln, f->binary)) == 0 && Bflag > 0) {
-			enqueue(&ln);
-			linesqueued++;
-		}
+		t = procline(&ln, f->binary);
 		c += t;
 
 		/* Count the matches if we have a match limit */
@@ -374,28 +372,25 @@
 	/* Dealing with the context */
 	if ((tail || c) && !cflag && !qflag && !lflag && !Lflag) {
 		if (c) {
-			if (!first && !prev && !tail && Aflag)
+			if ((Aflag || Bflag) && !first_global &&
+			(first || since_printed > Bflag))
 printf("--\n");
 			tail = Aflag;
-			if (Bflag > 0) {
-if (!first && !prev)
-	printf("--\n");
+			if (Bflag > 0)
 printqueue();
-			}
-			linesqueued = 0;
 			printline(l, ':', matches, m);
 		} else {
 			printline(l, '-', matches, m);
 			tail--;
 		}
-	}
-
-	if (c) {
-		prev = true;
 		first = false;
-	} else
-		prev = false;
-
+		first_global = false;
+		since_printed = 0;
+	} else {
+		if (Bflag)
+			enqueue(l);
+		since_printed++;
+	}
 	return (c);
 }
 



CVS commit: src/lib/libm/src

2011-04-18 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon Apr 18 15:59:09 UTC 2011

Modified Files:
src/lib/libm/src: s_nextafter.c s_nextafterf.c

Log Message:
according to C99/POSIX, nextafter(x,y) should return y if x==y, from
Henning Petersen per PR lib/44875


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/s_nextafter.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/s_nextafterf.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/libm/src/s_nextafter.c
diff -u src/lib/libm/src/s_nextafter.c:1.11 src/lib/libm/src/s_nextafter.c:1.12
--- src/lib/libm/src/s_nextafter.c:1.11	Sun May 26 22:01:57 2002
+++ src/lib/libm/src/s_nextafter.c	Mon Apr 18 15:59:09 2011
@@ -12,7 +12,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_nextafter.c,v 1.11 2002/05/26 22:01:57 wiz Exp $");
+__RCSID("$NetBSD: s_nextafter.c,v 1.12 2011/04/18 15:59:09 drochner Exp $");
 #endif
 
 /* IEEE functions
@@ -39,7 +39,7 @@
 	if(((ix>=0x7ff0)&&((ix-0x7ff0)|lx)!=0) ||   /* x is nan */
 	   ((iy>=0x7ff0)&&((iy-0x7ff0)|ly)!=0)) /* y is nan */
 	   return x+y;
-	if(x==y) return x;		/* x=y, return x */
+	if(x==y) return y;		/* x=y, return y */
 	if((ix|lx)==0) {			/* x == 0 */
 	INSERT_WORDS(x,hy&0x8000,1);	/* return +-minsubnormal */
 	y = x*x;

Index: src/lib/libm/src/s_nextafterf.c
diff -u src/lib/libm/src/s_nextafterf.c:1.7 src/lib/libm/src/s_nextafterf.c:1.8
--- src/lib/libm/src/s_nextafterf.c:1.7	Sun May 26 22:01:58 2002
+++ src/lib/libm/src/s_nextafterf.c	Mon Apr 18 15:59:09 2011
@@ -15,7 +15,7 @@
 
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: s_nextafterf.c,v 1.7 2002/05/26 22:01:58 wiz Exp $");
+__RCSID("$NetBSD: s_nextafterf.c,v 1.8 2011/04/18 15:59:09 drochner Exp $");
 #endif
 
 #include "math.h"
@@ -34,7 +34,7 @@
 	if((ix>0x7f80) ||   /* x is nan */
 	   (iy>0x7f80)) /* y is nan */
 	   return x+y;
-	if(x==y) return x;		/* x=y, return x */
+	if(x==y) return y;		/* x=y, return y */
 	if(ix==0) {/* x == 0 */
 	SET_FLOAT_WORD(x,(hy&0x8000)|1);/* return +-minsubnormal */
 	y = x*x;



CVS commit: src/sys

2011-04-18 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Apr 18 15:53:04 UTC 2011

Modified Files:
src/sys/miscfs/genfs: genfs_io.c
src/sys/miscfs/syncfs: sync_subr.c syncfs.h
src/sys/sys: vnode.h

Log Message:
G/C unused speedup_syncer() mechanism and thus simplify some code.
Update some comments to reflect the reality.  No actual changes to
the (used) syncer logic.

OK ad@


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.43 -r1.44 src/sys/miscfs/syncfs/sync_subr.c
cvs rdiff -u -r1.11 -r1.12 src/sys/miscfs/syncfs/syncfs.h
cvs rdiff -u -r1.227 -r1.228 src/sys/sys/vnode.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.46 src/sys/miscfs/genfs/genfs_io.c:1.47
--- src/sys/miscfs/genfs/genfs_io.c:1.46	Mon Dec  6 10:22:43 2010
+++ src/sys/miscfs/genfs/genfs_io.c	Mon Apr 18 15:53:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.46 2010/12/06 10:22:43 uebayasi Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.47 2011/04/18 15:53:04 rmind Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.46 2010/12/06 10:22:43 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.47 2011/04/18 15:53:04 rmind Exp $");
 
 #include 
 #include 
@@ -52,6 +52,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Index: src/sys/miscfs/syncfs/sync_subr.c
diff -u src/sys/miscfs/syncfs/sync_subr.c:1.43 src/sys/miscfs/syncfs/sync_subr.c:1.44
--- src/sys/miscfs/syncfs/sync_subr.c:1.43	Wed Jul 21 17:52:12 2010
+++ src/sys/miscfs/syncfs/sync_subr.c	Mon Apr 18 15:53:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sync_subr.c,v 1.43 2010/07/21 17:52:12 hannken Exp $	*/
+/*	$NetBSD: sync_subr.c,v 1.44 2011/04/18 15:53:04 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -60,8 +60,37 @@
  * SUCH DAMAGE.
  */
 
+/*
+ * The filesystem synchronizer mechanism - syncer.
+ *
+ * It is useful to delay writes of file data and filesystem metadata for
+ * a certain amount of time so that quickly created and deleted files need
+ * not waste disk bandwidth being created and removed.  To implement this,
+ * vnodes are appended to a "workitem" queue.
+ *
+ * Most pending metadata should not wait for more than ten seconds.  Thus,
+ * mounted on block devices are delayed only about a half the time that file
+ * data is delayed.  Similarly, directory updates are more critical, so are
+ * only delayed about a third the time that file data is delayed.
+ *
+ * There are SYNCER_MAXDELAY queues that are processed in a round-robin
+ * manner at a rate of one each second (driven off the filesystem syner
+ * thread). The syncer_delayno variable indicates the next queue that is
+ * to be processed.  Items that need to be processed soon are placed in
+ * this queue:
+ *
+ *	syncer_workitem_pending[syncer_delayno]
+ *
+ * A delay of e.g. fifteen seconds is done by placing the request fifteen
+ * entries later in the queue:
+ *
+ *	syncer_workitem_pending[(syncer_delayno + 15) & syncer_mask]
+ *
+ * Flag VI_ONWORKLST indicates that vnode is added into the queue.
+ */
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sync_subr.c,v 1.43 2010/07/21 17:52:12 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sync_subr.c,v 1.44 2011/04/18 15:53:04 rmind Exp $");
 
 #include 
 #include 
@@ -78,7 +107,10 @@
 #include 
 #include 
 
+typedef TAILQ_HEAD(synclist, vnode) synclist_t;
+
 static void	vn_syncer_add1(struct vnode *, int);
+static void	sysctl_vfs_syncfs_setup(struct sysctllog **);
 
 /*
  * Defines and variables for the syncer process.
@@ -90,19 +122,12 @@
 time_t metadelay = 10;			/* time to delay syncing metadata */
 time_t lockdelay = 1;			/* time to delay if locking fails */
 
-kmutex_t syncer_mutex;			/* used to freeze syncer, long term */
-static kmutex_t syncer_data_lock;	/* short term lock on data structures */
+kmutex_t		syncer_mutex;	/* used to freeze syncer, long term */
+static kmutex_t		syncer_data_lock; /* short term lock on data structs */
 
-static int rushjob;			/* number of slots to run ASAP */
-static kcondvar_t syncer_cv;		/* cv for rushjob */
-static int stat_rush_requests;		/* number of times I/O speeded up */
-
-static int syncer_delayno = 0;
-static long syncer_last;
-static struct synclist *syncer_workitem_pending;
-struct lwp *updateproc = NULL;
-
-static void sysctl_vfs_syncfs_setup(struct sysctllog **);
+static int		syncer_delayno = 0;
+static long		syncer_last;
+static synclist_t *	syncer_workitem_pending;
 
 void
 vn_initialize_syncerd(void)
@@ -121,57 +146,27 @@
 
 	mutex_init(&syncer_mutex, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(&syncer_data_lock, MUTEX_DEFAULT, IPL_NONE);
-	cv_init(&syncer_cv, "syncer");
 }
 
 /*
- * The workitem queue.
- *
- * It is useful to delay writes of file data and

CVS commit: src/external/historical/nawk/dist

2011-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 18 15:23:28 UTC 2011

Modified Files:
src/external/historical/nawk/dist: main.c run.c

Log Message:
PR/44876: Aleksey Cheusov: awk: incorrect return value of function srand()
Make it return the value of the previous random seed as the standard mandates.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/historical/nawk/dist/main.c
cvs rdiff -u -r1.2 -r1.3 src/external/historical/nawk/dist/run.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/historical/nawk/dist/main.c
diff -u src/external/historical/nawk/dist/main.c:1.4 src/external/historical/nawk/dist/main.c:1.5
--- src/external/historical/nawk/dist/main.c:1.4	Mon Oct 18 11:58:05 2010
+++ src/external/historical/nawk/dist/main.c	Mon Apr 18 11:23:28 2011
@@ -42,6 +42,7 @@
 extern	int	nfields;
 
 int	dbg	= 0;
+unsigned int srand_seed;
 char	*cmdname;	/* gets argv[0] for error messages */
 extern	FILE	*yyin;	/* lex input file */
 char	*lexprog;	/* points to program argument if it exists */
@@ -122,6 +123,10 @@
 #else
 	(void)signal(SIGFPE, fpecatch);
 #endif
+	/* Set and keep track of the random seed */
+	srand_seed = 1;
+	srand(srand_seed);
+
 	yyin = NULL;
 	symtab = makesymtab(NSYMTAB/NSYMTAB);
 	while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {

Index: src/external/historical/nawk/dist/run.c
diff -u src/external/historical/nawk/dist/run.c:1.2 src/external/historical/nawk/dist/run.c:1.3
--- src/external/historical/nawk/dist/run.c:1.2	Thu Aug 26 10:55:20 2010
+++ src/external/historical/nawk/dist/run.c	Mon Apr 18 11:23:28 2011
@@ -74,6 +74,7 @@
 
 jmp_buf env;
 extern	int	pairstack[];
+extern	unsigned int srand_seed;
 
 Node	*winner = NULL;	/* root of parse tree */
 Cell	*tmps;		/* free temporary cells for execution */
@@ -1546,6 +1547,7 @@
 	Cell *x, *y;
 	Awkfloat u;
 	int t, sz;
+	unsigned int tmp;
 	char *buf, *fmt;
 	Node *nextarg;
 	FILE *fp;
@@ -1598,7 +1600,9 @@
 			u = time((time_t *)0);
 		else
 			u = getfval(x);
-		srand((unsigned int) u);
+		srand(tmp = (unsigned int) u);
+		u = srand_seed;
+		srand_seed = tmp;
 		break;
 	case FTOUPPER:
 	case FTOLOWER:



CVS commit: src/doc

2011-04-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 18 08:36:14 UTC 2011

Modified Files:
src/doc: 3RDPARTY

Log Message:
less-443 is out.


To generate a diff of this commit:
cvs rdiff -u -r1.831 -r1.832 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.831 src/doc/3RDPARTY:1.832
--- src/doc/3RDPARTY:1.831	Sat Apr 16 06:39:02 2011
+++ src/doc/3RDPARTY	Mon Apr 18 08:36:14 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.831 2011/04/16 06:39:02 jruoho Exp $
+#	$NetBSD: 3RDPARTY,v 1.832 2011/04/18 08:36:14 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -503,7 +503,7 @@
 
 Package:	less
 Version:	less394
-Current Vers:	less436
+Current Vers:	less443
 Maintainer:	Mark Nudelman 
 Archive Site:	http://www.greenwoodsoftware.com/less/download.html
 Home Page:	http://www.greenwoodsoftware.com/less/
@@ -645,7 +645,7 @@
 The sources were integrated into src/sys/external/apache2/mDNSResponder/dist.
 
 Package:	mdocml
-Version:	1.10.9
+Version:	1.11.1
 Current Vers:	1.11.1
 Maintainer:	Kristaps Džonsons
 Archive Site:	http://mdocml.bsd.lv/snapshots/



CVS commit: src/sys/ufs/ffs

2011-04-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 18 07:36:14 UTC 2011

Modified Files:
src/sys/ufs/ffs: ffs_snapshot.c

Log Message:
Preallocate all cylinder group blocks so we no longer redo ~50% of
the cylinder groups while the file system is suspended.
This was removed in error with Rev 1.16.

>From Manuel Bouyer  via tech-kern.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/ufs/ffs/ffs_snapshot.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/ufs/ffs/ffs_snapshot.c
diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.111 src/sys/ufs/ffs/ffs_snapshot.c:1.112
--- src/sys/ufs/ffs/ffs_snapshot.c:1.111	Sun Mar  6 17:08:38 2011
+++ src/sys/ufs/ffs/ffs_snapshot.c	Mon Apr 18 07:36:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_snapshot.c,v 1.111 2011/03/06 17:08:38 bouyer Exp $	*/
+/*	$NetBSD: ffs_snapshot.c,v 1.112 2011/04/18 07:36:13 hannken Exp $	*/
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.111 2011/03/06 17:08:38 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.112 2011/04/18 07:36:13 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -405,7 +405,7 @@
 static int
 snapshot_setup(struct mount *mp, struct vnode *vp)
 {
-	int error, n, len, loc;
+	int error, n, len, loc, cg;
 	daddr_t blkno, numblks;
 	struct buf *ibp, *nbp;
 	struct fs *fs = VFSTOUFS(mp)->um_fs;
@@ -501,6 +501,28 @@
 		if (error)
 			goto out;
 		bawrite(nbp);
+		if (wbreak > 0 && (++n % wbreak) == 0) {
+			UFS_WAPBL_END(mp);
+			error = UFS_WAPBL_BEGIN(mp);
+			if (error)
+return error;
+		}
+	}
+	/*
+	 * Allocate all cylinder group blocks.
+	 */
+	for (cg = 0; cg < fs->fs_ncg; cg++) {
+		error = ffs_balloc(vp, lfragtosize(fs, cgtod(fs, cg)),
+		fs->fs_bsize, l->l_cred, 0, &nbp);
+		if (error)
+			goto out;
+		bawrite(nbp);
+		if (wbreak > 0 && (++n % wbreak) == 0) {
+			UFS_WAPBL_END(mp);
+			error = UFS_WAPBL_BEGIN(mp);
+			if (error)
+return error;
+		}
 	}
 
 out: