Re: CVS import: src/external/bsd/kyua-cli/dist

2013-10-19 Thread Marc Balmer
Am 19.10.13 01:40, schrieb Julio Merino:
 Module Name:  src
 Committed By: jmmv
 Date: Fri Oct 18 23:40:48 UTC 2013
 
 Update of /cvsroot/src/external/bsd/kyua-cli/dist
 In directory ivanova.netbsd.org:/tmp/cvs-serv22893
 
 Log Message:
 Update kyua-cli to 0.7:
 
 The major reason for this update is to support the just-imported lutok-0.3
 and, in turn, support the eventual update of the in-tree lua to 5.2.
 
 Changes:
 

[...]


 * Switched to use Lutok 0.3 to gain compatibility with Lua 5.2.

So your work would be safe and continue to build/work when Lua gets
updated to 5.2?


- Marc



Re: CVS import: src/external/bsd/kyua-cli/dist

2013-10-19 Thread Julio Merino
On Sat, Oct 19, 2013 at 7:32 AM, Marc Balmer m...@msys.ch wrote:
 Am 19.10.13 01:40, schrieb Julio Merino:
 Module Name:  src
 Committed By: jmmv
 Date: Fri Oct 18 23:40:48 UTC 2013

 Update of /cvsroot/src/external/bsd/kyua-cli/dist
 In directory ivanova.netbsd.org:/tmp/cvs-serv22893

 Log Message:
 Update kyua-cli to 0.7:

 The major reason for this update is to support the just-imported lutok-0.3
 and, in turn, support the eventual update of the in-tree lua to 5.2.

 Changes:


 [...]


 * Switched to use Lutok 0.3 to gain compatibility with Lua 5.2.

 So your work would be safe and continue to build/work when Lua gets
 updated to 5.2?

Correct!

-- 
Julio Merino / @jmmv


re: CVS commit: src/sys/arch

2013-10-19 Thread matthew green

 Module Name:  src
 Committed By: christos
 Date: Sat Oct 19 19:21:00 UTC 2013
 
 Modified Files:
   src/sys/arch/amiga/include: cpu.h
   src/sys/arch/atari/include: cpu.h
   src/sys/arch/cesfic/include: cpu.h
   src/sys/arch/hp300/include: cpu.h
   src/sys/arch/ia64/include: cpu.h
   src/sys/arch/luna68k/include: cpu.h
   src/sys/arch/mac68k/include: cpu.h
   src/sys/arch/mvme68k/include: cpu.h
   src/sys/arch/news68k/include: cpu.h
   src/sys/arch/next68k/include: cpu.h
   src/sys/arch/sh3/include: cpu.h
   src/sys/arch/sparc/include: cpu.h
   src/sys/arch/sun68k/include: cpu.h
   src/sys/arch/vax/include: cpu.h
   src/sys/arch/x68k/include: cpu.h
 
 Log Message:
 make cpu_need_resched() macros consistent; __USE flags

in my tree, i fixed this by turning cpu_need_resched()
into an inline function.  same way i've killed many of
the newer warnings.. 


.mrg.


re: CVS commit: src/sys/arch

2013-10-19 Thread Christos Zoulas
On Oct 20,  7:55am, m...@eterna.com.au (matthew green) wrote:
-- Subject: re: CVS commit: src/sys/arch

| in my tree, i fixed this by turning cpu_need_resched()
| into an inline function.  same way i've killed many of
| the newer warnings.. 
| 

Feel free to update it...

christos


CVS commit: src/sys/sys

2013-10-19 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Sat Oct 19 08:03:52 UTC 2013

Modified Files:
src/sys/sys: disklabel_gpt.h

Log Message:
add FreeBSD ZFS partition type


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/disklabel_gpt.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/sys/disklabel_gpt.h
diff -u src/sys/sys/disklabel_gpt.h:1.10 src/sys/sys/disklabel_gpt.h:1.11
--- src/sys/sys/disklabel_gpt.h:1.10	Fri Jan 18 17:43:35 2013
+++ src/sys/sys/disklabel_gpt.h	Sat Oct 19 08:03:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel_gpt.h,v 1.10 2013/01/18 17:43:35 jakllsch Exp $	*/
+/*	$NetBSD: disklabel_gpt.h,v 1.11 2013/10/19 08:03:52 jnemeth Exp $	*/
 
 /*
  * Copyright (c) 2002 Marcel Moolenaar
@@ -127,6 +127,8 @@ struct gpt_ent {
 	{0x516e7cb6,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
 #define	GPT_ENT_TYPE_FREEBSD_VINUM	\
 	{0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
+#define GPT_ENT_TYPE_FREEBSD_ZFS	\
+	{0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
 /*
  * The following are unused but documented here to avoid reuse.
  *



CVS commit: src/sbin/gpt

2013-10-19 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Sat Oct 19 08:13:21 UTC 2013

Modified Files:
src/sbin/gpt: migrate.c

Log Message:
- convert FreeBSD FS_type to numbers where they don't match NetBSD
- add support for migrating NetBSD disklabel'ed disks (only 7 years late)
- use labels for partition types


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/migrate.c

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

Modified files:

Index: src/sbin/gpt/migrate.c
diff -u src/sbin/gpt/migrate.c:1.8 src/sbin/gpt/migrate.c:1.9
--- src/sbin/gpt/migrate.c:1.8	Sat Oct 19 01:58:33 2013
+++ src/sbin/gpt/migrate.c	Sat Oct 19 08:13:21 2013
@@ -29,11 +29,12 @@
 __FBSDID($FreeBSD: src/sbin/gpt/migrate.c,v 1.16 2005/09/01 02:42:52 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: migrate.c,v 1.8 2013/10/19 01:58:33 jnemeth Exp $);
+__RCSID($NetBSD: migrate.c,v 1.9 2013/10/19 08:13:21 jnemeth Exp $);
 #endif
 
 #include sys/types.h
 #include sys/param.h
+#include sys/bootblock.h
 #include sys/disklabel.h
 
 #include err.h
@@ -119,14 +120,14 @@ migrate_disklabel(int fd, off_t start, s
 			ent-ent_name, 36);
 			break;
 		}
-		case FS_VINUM: {
+		case 14: {	/* Vinum */
 			static const uuid_t vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
 			le_uuid_enc(ent-ent_type, vinum);
 			utf8_to_utf16((const uint8_t *)FreeBSD vinum partition,
 			ent-ent_name, 36);
 			break;
 		}
-		case FS_ZFS: {
+		case 27: {	/* ZFS */
 			static const uuid_t zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
 			le_uuid_enc(ent-ent_type, zfs);
 			utf8_to_utf16((const uint8_t *)FreeBSD ZFS partition,
@@ -151,6 +152,100 @@ migrate_disklabel(int fd, off_t start, s
 	return (ent);
 }
 
+static struct gpt_ent*
+migrate_netbsd_disklabel(int fd, off_t start, struct gpt_ent *ent)
+{
+	char *buf;
+	struct disklabel *dl;
+	off_t ofs, rawofs;
+	int i;
+
+	buf = gpt_read(fd, start + LABELSECTOR, 1);
+	dl = (void*)(buf + LABELOFFSET);
+
+	if (le32toh(dl-d_magic) != DISKMAGIC ||
+	le32toh(dl-d_magic2) != DISKMAGIC) {
+		warnx(%s: warning: NetBSD slice without disklabel,
+		device_name);
+		return (ent);
+	}
+
+	rawofs = le32toh(dl-d_partitions[RAW_PART].p_offset) *
+	le32toh(dl-d_secsize);
+	for (i = 0; i  le16toh(dl-d_npartitions); i++) {
+		if (dl-d_partitions[i].p_fstype == FS_UNUSED)
+			continue;
+		ofs = le32toh(dl-d_partitions[i].p_offset) *
+		le32toh(dl-d_secsize);
+		if (ofs  rawofs)
+			rawofs = 0;
+	}
+	rawofs /= secsz;
+
+	for (i = 0; i  le16toh(dl-d_npartitions); i++) {
+		switch (dl-d_partitions[i].p_fstype) {
+		case FS_UNUSED:
+			continue;
+		case FS_SWAP: {
+			static const uuid_t swap = GPT_ENT_TYPE_NETBSD_SWAP;
+			le_uuid_enc(ent-ent_type, swap);
+			utf8_to_utf16((const uint8_t *)NetBSD swap partition,
+			ent-ent_name, 36);
+			break;
+		}
+		case FS_BSDFFS: {
+			static const uuid_t ufs = GPT_ENT_TYPE_NETBSD_FFS;
+			le_uuid_enc(ent-ent_type, ufs);
+			utf8_to_utf16((const uint8_t *)NetBSD FFS partition,
+			ent-ent_name, 36);
+			break;
+		}
+		case FS_BSDLFS: {
+			static const uuid_t zfs = GPT_ENT_TYPE_NETBSD_LFS;
+			le_uuid_enc(ent-ent_type, zfs);
+			utf8_to_utf16((const uint8_t *)NetBSD LFS partition,
+			ent-ent_name, 36);
+			break;
+		}
+		case FS_RAID: {
+			static const uuid_t zfs = GPT_ENT_TYPE_NETBSD_RAIDFRAME;
+			le_uuid_enc(ent-ent_type, zfs);
+			utf8_to_utf16((const uint8_t *)NetBSD RAIDframe partition,
+			ent-ent_name, 36);
+			break;
+		}
+		case FS_CCD: {
+			static const uuid_t zfs = GPT_ENT_TYPE_NETBSD_CCD;
+			le_uuid_enc(ent-ent_type, zfs);
+			utf8_to_utf16((const uint8_t *)NetBSD CCD partition,
+			ent-ent_name, 36);
+			break;
+		}
+		case FS_CGD: {
+			static const uuid_t zfs = GPT_ENT_TYPE_NETBSD_CGD;
+			le_uuid_enc(ent-ent_type, zfs);
+			utf8_to_utf16((const uint8_t *)NetBSD CGD partition,
+			ent-ent_name, 36);
+			break;
+		}
+		default:
+			warnx(%s: warning: unknown NetBSD partition (%d),
+			device_name, dl-d_partitions[i].p_fstype);
+			continue;
+		}
+
+		ofs = (le32toh(dl-d_partitions[i].p_offset) *
+		le32toh(dl-d_secsize)) / secsz;
+		ofs = (ofs  0) ? ofs - rawofs : 0;
+		ent-ent_lba_start = htole64(start + ofs);
+		ent-ent_lba_end = htole64(start + ofs +
+		le32toh(dl-d_partitions[i].p_size) - 1LL);
+		ent++;
+	}
+
+	return (ent);
+}
+
 static void
 migrate(int fd)
 {
@@ -262,9 +357,9 @@ migrate(int fd)
 		size = (size  16) + le16toh(mbr-mbr_part[i].part_size_lo);
 
 		switch (mbr-mbr_part[i].part_typ) {
-		case 0:
+		case MBR_PTYPE_UNUSED:
 			continue;
-		case 165: {	/* FreeBSD */
+		case MBR_PTYPE_386BSD: {	/* FreeBSD */
 			if (slice) {
 static const uuid_t freebsd = GPT_ENT_TYPE_FREEBSD;
 le_uuid_enc(ent-ent_type, freebsd);
@@ -277,7 +372,10 @@ migrate(int fd)
 ent = migrate_disklabel(fd, start, ent);
 			break;
 		}
-		case 239: {	/* EFI */
+		case MBR_PTYPE_NETBSD:
+			ent = migrate_netbsd_disklabel(fd, start, ent);
+			break;
+	

CVS commit: src/sbin/gpt

2013-10-19 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Sat Oct 19 09:31:24 UTC 2013

Modified Files:
src/sbin/gpt: migrate.c

Log Message:
Convert FreeBSD numeric FS_types to labels by request.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/migrate.c

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

Modified files:

Index: src/sbin/gpt/migrate.c
diff -u src/sbin/gpt/migrate.c:1.9 src/sbin/gpt/migrate.c:1.10
--- src/sbin/gpt/migrate.c:1.9	Sat Oct 19 08:13:21 2013
+++ src/sbin/gpt/migrate.c	Sat Oct 19 09:31:24 2013
@@ -29,7 +29,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/migrate.c,v 1.16 2005/09/01 02:42:52 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: migrate.c,v 1.9 2013/10/19 08:13:21 jnemeth Exp $);
+__RCSID($NetBSD: migrate.c,v 1.10 2013/10/19 09:31:24 jnemeth Exp $);
 #endif
 
 #include sys/types.h
@@ -58,6 +58,10 @@ __RCSID($NetBSD: migrate.c,v 1.9 2013/1
 #define	LABELSECTOR	1
 #endif
 
+/* FreeBSD filesystem types that don't match corresponding NetBSD types */
+#define	FREEBSD_FS_VINUM	14
+#define	FREEBSD_FS_ZFS		27
+
 static int force;
 static int slice;
 
@@ -120,14 +124,14 @@ migrate_disklabel(int fd, off_t start, s
 			ent-ent_name, 36);
 			break;
 		}
-		case 14: {	/* Vinum */
+		case FREEBSD_FS_VINUM: {
 			static const uuid_t vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
 			le_uuid_enc(ent-ent_type, vinum);
 			utf8_to_utf16((const uint8_t *)FreeBSD vinum partition,
 			ent-ent_name, 36);
 			break;
 		}
-		case 27: {	/* ZFS */
+		case FREEBSD_FS_ZFS: {
 			static const uuid_t zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
 			le_uuid_enc(ent-ent_type, zfs);
 			utf8_to_utf16((const uint8_t *)FreeBSD ZFS partition,



CVS commit: src/libexec/ld.elf_so

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 10:14:06 UTC 2013

Modified Files:
src/libexec/ld.elf_so: tls.c

Log Message:
Add debug code.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/libexec/ld.elf_so/tls.c

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

Modified files:

Index: src/libexec/ld.elf_so/tls.c
diff -u src/libexec/ld.elf_so/tls.c:1.7 src/libexec/ld.elf_so/tls.c:1.8
--- src/libexec/ld.elf_so/tls.c:1.7	Sat Apr 23 16:40:08 2011
+++ src/libexec/ld.elf_so/tls.c	Sat Oct 19 10:14:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tls.c,v 1.7 2011/04/23 16:40:08 joerg Exp $	*/
+/*	$NetBSD: tls.c,v 1.8 2013/10/19 10:14:06 skrll Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,12 +29,13 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: tls.c,v 1.7 2011/04/23 16:40:08 joerg Exp $);
+__RCSID($NetBSD: tls.c,v 1.8 2013/10/19 10:14:06 skrll Exp $);
 
 #include sys/param.h
 #include sys/ucontext.h
 #include lwp.h
 #include string.h
+#include debug.h
 #include rtld.h
 
 #if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
@@ -100,6 +101,7 @@ _rtld_tls_initial_allocation(void)
 	_rtld_tls_static_space = roundup2(_rtld_tls_static_space,
 	sizeof(void *));
 #endif
+	dbg((_rtld_tls_static_space %zu, _rtld_tls_static_space));
 
 	tcb = _rtld_tls_allocate_locked();
 #ifdef __HAVE___LWP_SETTCB
@@ -132,6 +134,7 @@ _rtld_tls_allocate_locked(void)
 	tcb = (struct tls_tcb *)p;
 	tcb-tcb_self = tcb;
 #endif
+	dbg((tcb %p, tcb));
 	tcb-tcb_dtv = xcalloc(sizeof(*tcb-tcb_dtv) * (2 + _rtld_tls_max_index));
 	++tcb-tcb_dtv;
 	SET_DTV_MAX_INDEX(tcb-tcb_dtv, _rtld_tls_max_index);
@@ -144,6 +147,8 @@ _rtld_tls_allocate_locked(void)
 #else
 			q = p - obj-tlsoffset;
 #endif
+			dbg((obj %p dtv %p tlsoffset %zu,
+			obj, q, obj-tlsoffset));
 			memcpy(q, obj-tlsinit, obj-tlsinitsize);
 			tcb-tcb_dtv[obj-tlsindex] = q;
 		}



CVS commit: src/sys/arch/hp700/hp700

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:13:09 UTC 2013

Modified Files:
src/sys/arch/hp700/hp700: intr.c

Log Message:
Sprinkle __unused.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp700/hp700/intr.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/hp700/hp700/intr.c
diff -u src/sys/arch/hp700/hp700/intr.c:1.41 src/sys/arch/hp700/hp700/intr.c:1.42
--- src/sys/arch/hp700/hp700/intr.c:1.41	Wed May 23 16:11:37 2012
+++ src/sys/arch/hp700/hp700/intr.c	Sat Oct 19 13:13:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.41 2012/05/23 16:11:37 skrll Exp $	*/
+/*	$NetBSD: intr.c,v 1.42 2013/10/19 13:13:09 skrll Exp $	*/
 /*	$OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $	*/
 
 /*
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.41 2012/05/23 16:11:37 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.42 2013/10/19 13:13:09 skrll Exp $);
 
 #define __MUTEX_PRIVATE
 
@@ -408,7 +408,7 @@ hp700_intr_dispatch(int ncpl, int eiem, 
 	int ipending_run;
 	int bit_pos;
 	void *arg;
-	int handled;
+	int handled __unused;
 	bool locked = false;
 
 	/*



CVS commit: src/sys/arch/hp700/hp700

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:15:53 UTC 2013

Modified Files:
src/sys/arch/hp700/hp700: mainbus.c

Log Message:
Add __unused to a variable


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/hp700/hp700/mainbus.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/hp700/hp700/mainbus.c
diff -u src/sys/arch/hp700/hp700/mainbus.c:1.83 src/sys/arch/hp700/hp700/mainbus.c:1.84
--- src/sys/arch/hp700/hp700/mainbus.c:1.83	Wed May 23 16:11:37 2012
+++ src/sys/arch/hp700/hp700/mainbus.c	Sat Oct 19 13:15:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.83 2012/05/23 16:11:37 skrll Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.84 2013/10/19 13:15:53 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mainbus.c,v 1.83 2012/05/23 16:11:37 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: mainbus.c,v 1.84 2013/10/19 13:15:53 skrll Exp $);
 
 #include locators.h
 #include power.h
@@ -1243,7 +1243,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 	bmask = ~(map-_dm_boundary - 1);
 
 	for (seg = *segp; buflen  0; ) {
-		bool ok;
+		bool ok __unused;
 		/*
 		 * Get the physical address for this segment.
 		 */



CVS commit: src/sys/arch/hp700/hp700

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:16:30 UTC 2013

Modified Files:
src/sys/arch/hp700/hp700: machdep.c

Log Message:
Use __unused for a variable and use the correct #ifdef for a block of
code.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/hp700/hp700/machdep.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/hp700/hp700/machdep.c
diff -u src/sys/arch/hp700/hp700/machdep.c:1.115 src/sys/arch/hp700/hp700/machdep.c:1.116
--- src/sys/arch/hp700/hp700/machdep.c:1.115	Sat Jul 28 19:08:23 2012
+++ src/sys/arch/hp700/hp700/machdep.c	Sat Oct 19 13:16:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.115 2012/07/28 19:08:23 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.116 2013/10/19 13:16:30 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.115 2012/07/28 19:08:23 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.116 2013/10/19 13:16:30 skrll Exp $);
 
 #include opt_cputype.h
 #include opt_ddb.h
@@ -1071,7 +1071,7 @@ static int
 _hp700_btlb_insert(struct btlb_slot *btlb_slot)
 {
 	int error;
-#ifdef DEBUG
+#ifdef MACHDEPDEBUG
 	const char *prot;
 
 	/* Display the protection like a file protection. */
@@ -1741,7 +1741,7 @@ cpu_dump(void)
 {
 	long buf[dbtob(1) / sizeof (long)];
 	kcore_seg_t	*segp;
-	cpu_kcore_hdr_t	*cpuhdrp;
+	cpu_kcore_hdr_t	*cpuhdrp __unused;
 	const struct bdevsw *bdev;
 
 	segp = (kcore_seg_t *)buf;



CVS commit: src/sys/arch/hp700/gsc

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:18:03 UTC 2013

Modified Files:
src/sys/arch/hp700/gsc: harmony.c

Log Message:
Actually return any error.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hp700/gsc/harmony.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/hp700/gsc/harmony.c
diff -u src/sys/arch/hp700/gsc/harmony.c:1.27 src/sys/arch/hp700/gsc/harmony.c:1.28
--- src/sys/arch/hp700/gsc/harmony.c:1.27	Thu Feb 23 21:41:23 2012
+++ src/sys/arch/hp700/gsc/harmony.c	Sat Oct 19 13:18:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: harmony.c,v 1.27 2012/02/23 21:41:23 skrll Exp $	*/
+/*	$NetBSD: harmony.c,v 1.28 2013/10/19 13:18:03 skrll Exp $	*/
 
 /*	$OpenBSD: harmony.c,v 1.23 2004/02/13 21:28:19 mickey Exp $	*/
 
@@ -919,7 +919,7 @@ harmony_get_port(void *vsc, mixer_ctrl_t
 		err = 0;
 		break;
 	}
-	return 0;
+	return err;
 }
 
 int



CVS commit: src/sys/arch/hp700/hp700

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:21:43 UTC 2013

Modified Files:
src/sys/arch/hp700/hp700: autoconf.c

Log Message:
Remember to unmap pagezero once we've finished with it. Found by gcc 4.8.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/hp700/hp700/autoconf.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/hp700/hp700/autoconf.c
diff -u src/sys/arch/hp700/hp700/autoconf.c:1.50 src/sys/arch/hp700/hp700/autoconf.c:1.51
--- src/sys/arch/hp700/hp700/autoconf.c:1.50	Sat Oct 27 17:17:52 2012
+++ src/sys/arch/hp700/hp700/autoconf.c	Sat Oct 19 13:21:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.50 2012/10/27 17:17:52 chs Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.51 2013/10/19 13:21:43 skrll Exp $	*/
 
 /*	$OpenBSD: autoconf.c,v 1.15 2001/06/25 00:43:10 mickey Exp $	*/
 
@@ -86,7 +86,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.50 2012/10/27 17:17:52 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.51 2013/10/19 13:21:43 skrll Exp $);
 
 #include opt_kgdb.h
 #include opt_useleds.h
@@ -471,6 +471,8 @@ cpu_rootconf(void)
 	}
 	printf(dp_flags 0x%x pz_class 0x%x\n, PAGE0-mem_boot.pz_dp.dp_flags,
 	PAGE0-mem_boot.pz_class);
+
+	hp700_pagezero_unmap(pagezero_cookie);
 #endif /* DEBUG */
 
 	if (boot_device != NULL)



CVS commit: src/sys/arch/hp700/dev

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:28:37 UTC 2013

Modified Files:
src/sys/arch/hp700/dev: sti_sgc.c

Log Message:
Remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/sti_sgc.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/hp700/dev/sti_sgc.c
diff -u src/sys/arch/hp700/dev/sti_sgc.c:1.21 src/sys/arch/hp700/dev/sti_sgc.c:1.22
--- src/sys/arch/hp700/dev/sti_sgc.c:1.21	Fri Jul  1 18:33:09 2011
+++ src/sys/arch/hp700/dev/sti_sgc.c	Sat Oct 19 13:28:36 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sti_sgc.c,v 1.21 2011/07/01 18:33:09 dyoung Exp $	*/
+/*	$NetBSD: sti_sgc.c,v 1.22 2013/10/19 13:28:36 skrll Exp $	*/
 
 /*	$OpenBSD: sti_sgc.c,v 1.38 2009/02/06 22:51:04 miod Exp $	*/
 
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sti_sgc.c,v 1.21 2011/07/01 18:33:09 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: sti_sgc.c,v 1.22 2013/10/19 13:28:36 skrll Exp $);
 
 #include opt_cputype.h
 
@@ -143,7 +143,7 @@ sti_sgc_probe(device_t parent, cfdata_t 
 	struct confargs *ca = aux;
 	bus_space_handle_t romh;
 	paddr_t rom;
-	uint32_t id, romend;
+	uint32_t id;
 	u_char devtype;
 	int rv = 0, romunmapped = 0;
 
@@ -197,7 +197,6 @@ sti_sgc_probe(device_t parent, cfdata_t 
 	default:
 		DPRINTF((%s: unknown type (%x)\n, __func__, devtype));
 		rv = 0;
-		romend = 0;
 	}
 
 	if (rv 



CVS commit: src/sys/arch/hp700/dev

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:29:10 UTC 2013

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
__unused


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.41 src/sys/arch/hp700/dev/pdc.c:1.42
--- src/sys/arch/hp700/dev/pdc.c:1.41	Sun Feb  5 21:46:37 2012
+++ src/sys/arch/hp700/dev/pdc.c	Sat Oct 19 13:29:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.41 2012/02/05 21:46:37 skrll Exp $	*/
+/*	$NetBSD: pdc.c,v 1.42 2013/10/19 13:29:10 skrll Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pdc.c,v 1.41 2012/02/05 21:46:37 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pdc.c,v 1.42 2013/10/19 13:29:10 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -460,7 +460,7 @@ pdccninit(struct consdev *cn)
 int
 pdccnlookc(dev_t dev, int *cp)
 {
-	int s, err, l, pagezero_cookie;
+	int s, err __unused, l, pagezero_cookie;
 
 	s = splhigh();
 	pagezero_cookie = hp700_pagezero_map();



CVS commit: src/sbin/newfs_ext2fs

2013-10-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 19 13:42:10 UTC 2013

Modified Files:
src/sbin/newfs_ext2fs: mke2fs.c

Log Message:
Wrap long lines overflowed after EXT2_ prefix addtion to fs macro.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sbin/newfs_ext2fs/mke2fs.c

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

Modified files:

Index: src/sbin/newfs_ext2fs/mke2fs.c
diff -u src/sbin/newfs_ext2fs/mke2fs.c:1.20 src/sbin/newfs_ext2fs/mke2fs.c:1.21
--- src/sbin/newfs_ext2fs/mke2fs.c:1.20	Sun Jun 23 02:06:05 2013
+++ src/sbin/newfs_ext2fs/mke2fs.c	Sat Oct 19 13:42:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mke2fs.c,v 1.20 2013/06/23 02:06:05 dholland Exp $	*/
+/*	$NetBSD: mke2fs.c,v 1.21 2013/10/19 13:42:10 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2007 Izumi Tsutsui.  All rights reserved.
@@ -100,7 +100,7 @@
 #if 0
 static char sccsid[] = @(#)mkfs.c	8.11 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: mke2fs.c,v 1.20 2013/06/23 02:06:05 dholland Exp $);
+__RCSID($NetBSD: mke2fs.c,v 1.21 2013/10/19 13:42:10 tsutsui Exp $);
 #endif
 #endif /* not lint */
 
@@ -729,8 +729,8 @@ initcg(uint cylno)
 	i = i * NBBY;
 	for (; i  cgoverhead(cylno); i++)
 		setbit(buf, i);
-	wtfs(EXT2_FSBTODB(sblock, gd[cylno].ext2bgd_b_bitmap), sblock.e2fs_bsize,
-	buf);
+	wtfs(EXT2_FSBTODB(sblock, gd[cylno].ext2bgd_b_bitmap),
+	sblock.e2fs_bsize, buf);
 
 	/*
 	 * Initialize inode bitmap.
@@ -747,8 +747,8 @@ initcg(uint cylno)
 		for (i = 1; i  EXT2_FIRSTINO; i++)
 			setbit(buf, EXT2_INO_INDEX(i));
 	}
-	wtfs(EXT2_FSBTODB(sblock, gd[cylno].ext2bgd_i_bitmap), sblock.e2fs_bsize,
-	buf);
+	wtfs(EXT2_FSBTODB(sblock, gd[cylno].ext2bgd_i_bitmap),
+	sblock.e2fs_bsize, buf);
 
 	/*
 	 * Initialize inode tables.
@@ -960,13 +960,14 @@ fsinit(const struct timeval *tv)
 		}
 		node.e2di_blocks[i] = blk;
 	}
-	wtfs(EXT2_FSBTODB(sblock, node.e2di_blocks[0]), sblock.e2fs_bsize, buf);
+	wtfs(EXT2_FSBTODB(sblock, node.e2di_blocks[0]),
+	sblock.e2fs_bsize, buf);
 	pad_dir.e2d_reclen = sblock.e2fs_bsize;
 	for (i = 1; i  nblks_lostfound; i++) {
 		memset(buf, 0, sblock.e2fs_bsize);
 		copy_dir(pad_dir, (struct ext2fs_direct *)buf);
-		wtfs(EXT2_FSBTODB(sblock, node.e2di_blocks[i]), sblock.e2fs_bsize,
-		buf);
+		wtfs(EXT2_FSBTODB(sblock, node.e2di_blocks[i]),
+		sblock.e2fs_bsize, buf);
 	}
 	iput(node, EXT2_LOSTFOUNDINO);
 #endif
@@ -997,7 +998,8 @@ fsinit(const struct timeval *tv)
 		printf(%s: can't allocate block for root dir\n, __func__);
 		return 0;
 	}
-	wtfs(EXT2_FSBTODB(sblock, node.e2di_blocks[0]), sblock.e2fs_bsize, buf);
+	wtfs(EXT2_FSBTODB(sblock, node.e2di_blocks[0]),
+	sblock.e2fs_bsize, buf);
 	iput(node, EXT2_ROOTINO);
 	return 1;
 }
@@ -1121,7 +1123,8 @@ init_resizeino(const struct timeval *tv)
 	/* set e2di_size which occupies whole blocks through DINDIR blocks */
 	isize = (uint64_t)sblock.e2fs_bsize * EXT2FS_NDADDR +
 	(uint64_t)sblock.e2fs_bsize * EXT2_NINDIR(sblock) +
-	(uint64_t)sblock.e2fs_bsize * EXT2_NINDIR(sblock) * EXT2_NINDIR(sblock);
+	(uint64_t)sblock.e2fs_bsize * EXT2_NINDIR(sblock) *
+	EXT2_NINDIR(sblock);
 	if (isize  UINT32_MAX 
 	(sblock.e2fs.e2fs_features_rocompat 
 	 EXT2F_ROCOMPAT_LARGEFILE) == 0) {
@@ -1261,7 +1264,8 @@ alloc(uint32_t size, uint16_t mode)
 	bbp = malloc(sblock.e2fs_bsize);
 	if (bbp == NULL)
 		return 0;
-	rdfs(EXT2_FSBTODB(sblock, gd[0].ext2bgd_b_bitmap), sblock.e2fs_bsize, bbp);
+	rdfs(EXT2_FSBTODB(sblock, gd[0].ext2bgd_b_bitmap),
+	sblock.e2fs_bsize, bbp);
 
 	/* XXX: kernel uses e2fs_fpg here */
 	len = sblock.e2fs.e2fs_bpg / NBBY;
@@ -1295,7 +1299,8 @@ alloc(uint32_t size, uint16_t mode)
 		errx(EXIT_FAILURE, %s: inconsistent bitmap\n, __func__);
 
 	setbit(bbp, bno);
-	wtfs(EXT2_FSBTODB(sblock, gd[0].ext2bgd_b_bitmap), sblock.e2fs_bsize, bbp);
+	wtfs(EXT2_FSBTODB(sblock, gd[0].ext2bgd_b_bitmap),
+	sblock.e2fs_bsize, bbp);
 	free(bbp);
 	/* XXX: modified group descriptors won't be written into backups */
 	gd[0].ext2bgd_nbfree--;



CVS commit: src/sys/arch/hp700/dev

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:49:11 UTC 2013

Modified Files:
src/sys/arch/hp700/dev: asp.c dino.c elroy.c lasi.c wax.c

Log Message:
Appease gcc 4.8.

XXX should really use bus_space(9)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hp700/dev/asp.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/hp700/dev/dino.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp700/dev/elroy.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp700/dev/lasi.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/wax.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/hp700/dev/asp.c
diff -u src/sys/arch/hp700/dev/asp.c:1.22 src/sys/arch/hp700/dev/asp.c:1.23
--- src/sys/arch/hp700/dev/asp.c:1.22	Wed Oct 10 15:46:33 2012
+++ src/sys/arch/hp700/dev/asp.c	Sat Oct 19 13:49:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asp.c,v 1.22 2012/10/10 15:46:33 skrll Exp $	*/
+/*	$NetBSD: asp.c,v 1.23 2013/10/19 13:49:11 skrll Exp $	*/
 
 /*	$OpenBSD: asp.c,v 1.5 2000/02/09 05:04:22 mickey Exp $	*/
 
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: asp.c,v 1.22 2012/10/10 15:46:33 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: asp.c,v 1.23 2013/10/19 13:49:11 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -189,7 +189,6 @@ aspattach(device_t parent, device_t self
 	struct gsc_attach_args ga;
 	struct cpu_info *ci = cpus[0];
 	bus_space_handle_t ioh;
-	uint32_t irr;
 	int s;
 
 	sc-sc_dev = self;
@@ -245,7 +244,7 @@ aspattach(device_t parent, device_t self
 	viper_setintrwnd(1  ca-ca_irq);
 
 	sc-sc_trs-asp_imr = ~0;
-	irr = sc-sc_trs-asp_irr;
+	(void)sc-sc_trs-asp_irr;
 	sc-sc_trs-asp_imr = 0;
 
 	/* Establish the interrupt register. */

Index: src/sys/arch/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.36 src/sys/arch/hp700/dev/dino.c:1.37
--- src/sys/arch/hp700/dev/dino.c:1.36	Wed May 23 16:11:37 2012
+++ src/sys/arch/hp700/dev/dino.c	Sat Oct 19 13:49:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.36 2012/05/23 16:11:37 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.37 2013/10/19 13:49:11 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dino.c,v 1.36 2012/05/23 16:11:37 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: dino.c,v 1.37 2013/10/19 13:49:11 skrll Exp $);
 
 /* #include cardbus.h */
 
@@ -356,7 +356,6 @@ dino_conf_write(void *v, pcitag_t tag, i
 {
 	struct dino_softc *sc = v;
 	volatile struct dino_regs *r = sc-sc_regs;
-	pcireg_t data1;
 	uint32_t pamr;
 
 	/* fix arbitration errata by disabling all pci devs on config read */
@@ -368,7 +367,7 @@ dino_conf_write(void *v, pcitag_t tag, i
 
 	/* fix coalescing config and io writes by interleaving w/ a read */
 	r-pci_addr = tag | PCI_ID_REG;
-	data1 = r-pci_conf_data;
+	(void)r-pci_conf_data;
 
 	/* restore arbitration */
 	r-pamr = pamr;
@@ -1605,7 +1604,6 @@ dinoattach(device_t parent, device_t sel
 	volatile struct dino_regs *r;
 	struct cpu_info *ci = cpus[0];
 	const char *p = NULL;
-	u_int data;
 	int s, ver;
 
 	sc-sc_dv = self;
@@ -1650,7 +1648,7 @@ dinoattach(device_t parent, device_t sel
 	s = splhigh();
 	r-icr = 0;
 	r-imr = ~0;
-	data = r-irr0;
+	(void)r-irr0;
 	r-imr = 0;
 	r-iar0 = ci-ci_hpa | (31 - ca-ca_irq);
 	splx(s);

Index: src/sys/arch/hp700/dev/elroy.c
diff -u src/sys/arch/hp700/dev/elroy.c:1.13 src/sys/arch/hp700/dev/elroy.c:1.14
--- src/sys/arch/hp700/dev/elroy.c:1.13	Wed Oct 10 15:46:34 2012
+++ src/sys/arch/hp700/dev/elroy.c	Sat Oct 19 13:49:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroy.c,v 1.13 2012/10/10 15:46:34 skrll Exp $	*/
+/*	$NetBSD: elroy.c,v 1.14 2013/10/19 13:49:11 skrll Exp $	*/
 
 /*	$OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $	*/
 
@@ -254,7 +254,7 @@ elroy_conf_read(void *v, pcitag_t tag, i
 	struct elroy_softc *sc = v;
 	volatile struct elroy_regs *r = sc-sc_regs;
 	uint32_t arb_mask, err_cfg, control;
-	pcireg_t data, data1;
+	pcireg_t data;
 
 /* printf(elroy_conf_read(%p, 0x%08x, 0x%x), v, tag, reg); */
 	arb_mask = elroy_read32(r-arb_mask);
@@ -268,7 +268,7 @@ elroy_conf_read(void *v, pcitag_t tag, i
 	~htole32(ELROY_CONTROL_HF));
 
 	elroy_write32(r-pci_conf_addr, htole32(tag | reg));
-	data1 = elroy_read32(r-pci_conf_addr);
+	(void)elroy_read32(r-pci_conf_addr);
 	data = elroy_read32(r-pci_conf_data);
 
 	elroy_write32(r-control, control |
@@ -289,7 +289,6 @@ elroy_conf_write(void *v, pcitag_t tag, 
 	struct elroy_softc *sc = v;
 	volatile struct elroy_regs *r = sc-sc_regs;
 	uint32_t arb_mask, err_cfg, control;
-	pcireg_t data1;
 
 /* printf(elroy_conf_write(%p, 0x%08x, 0x%x, 0x%x)\n, v, tag, reg, data); */
 	arb_mask = elroy_read32(r-arb_mask);
@@ -304,13 +303,13 @@ elroy_conf_write(void *v, pcitag_t tag, 
 
 	/* fix coalescing config writes errata by interleaving w/ a read */
 	elroy_write32(r-pci_conf_addr, htole32(tag | 

CVS commit: src/sys/arch/hp700/hp700

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 14:01:00 UTC 2013

Modified Files:
src/sys/arch/hp700/hp700: disksubr.c

Log Message:
Remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hp700/hp700/disksubr.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/hp700/hp700/disksubr.c
diff -u src/sys/arch/hp700/hp700/disksubr.c:1.27 src/sys/arch/hp700/hp700/disksubr.c:1.28
--- src/sys/arch/hp700/hp700/disksubr.c:1.27	Thu Feb 23 21:38:53 2012
+++ src/sys/arch/hp700/hp700/disksubr.c	Sat Oct 19 14:00:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.27 2012/02/23 21:38:53 skrll Exp $	*/
+/*	$NetBSD: disksubr.c,v 1.28 2013/10/19 14:00:59 skrll Exp $	*/
 
 /*	$OpenBSD: disksubr.c,v 1.6 2000/10/18 21:00:34 mickey Exp $	*/
 
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.27 2012/02/23 21:38:53 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: disksubr.c,v 1.28 2013/10/19 14:00:59 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -159,7 +159,7 @@ readdisklabel(dev_t dev, void (*strat)(s
 	struct buf *bp = NULL;
 	const char *msg = no disk label;
 	int i;
-	struct disklabel minilabel, fallbacklabel;
+	struct disklabel fallbacklabel;
 
 	/* minimal requirements for archetypal disk label */
 	if (lp-d_secsize == 0)
@@ -177,7 +177,7 @@ readdisklabel(dev_t dev, void (*strat)(s
 	if (lp-d_partitions[i].p_size == 0)
 		lp-d_partitions[i].p_size = 0x1fff;
 	lp-d_partitions[i].p_offset = 0;
-	minilabel = fallbacklabel = *lp;
+	fallbacklabel = *lp;
 
 	/* get a buffer and initialize it */
 	bp = geteblk((int)lp-d_secsize);



CVS commit: src/sys/arch/hp700/gsc

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 14:01:42 UTC 2013

Modified Files:
src/sys/arch/hp700/gsc: lpt_gsc.c

Log Message:
Remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp700/gsc/lpt_gsc.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/hp700/gsc/lpt_gsc.c
diff -u src/sys/arch/hp700/gsc/lpt_gsc.c:1.14 src/sys/arch/hp700/gsc/lpt_gsc.c:1.15
--- src/sys/arch/hp700/gsc/lpt_gsc.c:1.14	Fri Jul  1 18:33:09 2011
+++ src/sys/arch/hp700/gsc/lpt_gsc.c	Sat Oct 19 14:01:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lpt_gsc.c,v 1.14 2011/07/01 18:33:09 dyoung Exp $	*/
+/*	$NetBSD: lpt_gsc.c,v 1.15 2013/10/19 14:01:42 skrll Exp $	*/
 
 /*	$OpenBSD: lpt_gsc.c,v 1.6 2000/07/21 17:41:06 mickey Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: lpt_gsc.c,v 1.14 2011/07/01 18:33:09 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: lpt_gsc.c,v 1.15 2013/10/19 14:01:42 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -139,7 +139,7 @@ lpt_gsc_probe(device_t parent, cfdata_t 
 	bus_space_handle_t ioh;
 	bus_addr_t base;
 	uint8_t mask, data;
-	int i, rv;
+	int i;
 
 	if (ga-ga_type.iodc_type != HPPA_TYPE_FIO ||
 	ga-ga_type.iodc_sv_model != HPPA_FIO_CENT)
@@ -165,7 +165,6 @@ lpt_gsc_probe(device_t parent, cfdata_t 
 	if (bus_space_map(ga-ga_iot, base, LPT_NPORTS, 0, ioh))
 		return 0;
 
-	rv = 0;
 	mask = 0xff;
 
 	data = 0x55;/* Alternating zeros */



CVS commit: src/sys/arch/hppa/hppa

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 14:03:04 UTC 2013

Modified Files:
src/sys/arch/hppa/hppa: db_trace.c

Log Message:
#if 0 some unsed code which should probably be finished.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/hppa/db_trace.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/hppa/hppa/db_trace.c
diff -u src/sys/arch/hppa/hppa/db_trace.c:1.12 src/sys/arch/hppa/hppa/db_trace.c:1.13
--- src/sys/arch/hppa/hppa/db_trace.c:1.12	Wed Jan 18 09:35:48 2012
+++ src/sys/arch/hppa/hppa/db_trace.c	Sat Oct 19 14:03:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.12 2012/01/18 09:35:48 skrll Exp $	*/
+/*	$NetBSD: db_trace.c,v 1.13 2013/10/19 14:03:04 skrll Exp $	*/
 
 /*	$OpenBSD: db_interface.c,v 1.16 2001/03/22 23:31:45 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.12 2012/01/18 09:35:48 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.13 2013/10/19 14:03:04 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -47,7 +47,9 @@ db_stack_trace_print(db_expr_t addr, boo
 const char *modif, void (*pr)(const char *, ...))
 {
 	register_t *fp, pc, rp;
+#if 0
 	bool kernel_only = true;
+#endif
 	bool trace_thread = false;
 	bool lwpaddr = false;
 	db_sym_t sym;
@@ -66,8 +68,10 @@ db_stack_trace_print(db_expr_t addr, boo
 		}
 		if (c == 't')
 			trace_thread = true;
+#if 0
 		if (c == 'u')
 			kernel_only = false;
+#endif
 	}
 
 	if (!have_addr) {



CVS commit: src/sys/arch/hppa/hppa

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 14:02:29 UTC 2013

Modified Files:
src/sys/arch/hppa/hppa: trap.c

Log Message:
Use __unused on a variable used in a KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.c
diff -u src/sys/arch/hppa/hppa/trap.c:1.102 src/sys/arch/hppa/hppa/trap.c:1.103
--- src/sys/arch/hppa/hppa/trap.c:1.102	Sat Jul 13 10:29:37 2013
+++ src/sys/arch/hppa/hppa/trap.c	Sat Oct 19 14:02:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.102 2013/07/13 10:29:37 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.103 2013/10/19 14:02:29 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.102 2013/07/13 10:29:37 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.103 2013/10/19 14:02:29 skrll Exp $);
 
 /* #define INTRDEBUG */
 /* #define TRAPDEBUG */
@@ -1301,7 +1301,7 @@ startlwp(void *arg)
 {
 	ucontext_t *uc = arg;
 	lwp_t *l = curlwp;
-	int error;
+	int error __unused;
 
 	error = cpu_setmcontext(l, uc-uc_mcontext, uc-uc_flags);
 	KASSERT(error == 0);



CVS commit: src/sys/ddb

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 14:33:07 UTC 2013

Modified Files:
src/sys/ddb: db_run.c

Log Message:
Mark a potentialy unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/ddb/db_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/sys/ddb/db_run.c
diff -u src/sys/ddb/db_run.c:1.31 src/sys/ddb/db_run.c:1.32
--- src/sys/ddb/db_run.c:1.31	Sun Sep 23 23:55:55 2007
+++ src/sys/ddb/db_run.c	Sat Oct 19 14:33:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_run.c,v 1.31 2007/09/23 23:55:55 martin Exp $	*/
+/*	$NetBSD: db_run.c,v 1.32 2013/10/19 14:33:07 martin Exp $	*/
 
 /*
  * Mach Operating System
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_run.c,v 1.31 2007/09/23 23:55:55 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_run.c,v 1.32 2013/10/19 14:33:07 martin Exp $);
 
 #include opt_ddb.h
 
@@ -197,7 +197,7 @@ db_restart_at_pc(db_regs_t *regs, bool w
 	if ((db_run_mode == STEP_COUNT) ||
 	(db_run_mode == STEP_RETURN) ||
 	(db_run_mode == STEP_CALLT)) {
-		db_expr_t		ins;
+		db_expr_t		ins __unused;
 
 		/*
 		 * We are about to execute this instruction,



CVS commit: src/sys/ddb

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 15:20:52 UTC 2013

Modified Files:
src/sys/ddb: db_command.c

Log Message:
fix userland build, by moving all the unused stuff inside ifdef _KERNEL


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/ddb/db_command.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/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.142 src/sys/ddb/db_command.c:1.143
--- src/sys/ddb/db_command.c:1.142	Sat Jan  5 23:17:27 2013
+++ src/sys/ddb/db_command.c	Sat Oct 19 11:20:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.142 2013/01/06 04:17:27 christos Exp $	*/
+/*	$NetBSD: db_command.c,v 1.143 2013/10/19 15:20:52 christos Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_command.c,v 1.142 2013/01/06 04:17:27 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_command.c,v 1.143 2013/10/19 15:20:52 christos Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_aio.h
@@ -969,6 +969,7 @@ static void
 db_map_print_cmd(db_expr_t addr, bool have_addr, db_expr_t count,
 const char *modif)
 {
+#ifdef _KERNEL
 	bool full = false;
 
 	if (modif[0] == 'f')
@@ -977,7 +978,6 @@ db_map_print_cmd(db_expr_t addr, bool ha
 	if (have_addr == false)
 		addr = (db_expr_t)(uintptr_t)db_read_ptr(kernel_map);
 
-#ifdef _KERNEL
 	uvm_map_printit((struct vm_map *)(uintptr_t) addr, full, db_printf);
 #endif	/* XXX CRASH(8) */
 }
@@ -987,12 +987,12 @@ static void
 db_object_print_cmd(db_expr_t addr, bool have_addr,
 db_expr_t count, const char *modif)
 {
+#ifdef _KERNEL /* XXX CRASH(8) */
 	bool full = false;
 
 	if (modif[0] == 'f')
 		full = true;
 
-#ifdef _KERNEL /* XXX CRASH(8) */
 	uvm_object_printit((struct uvm_object *)(uintptr_t) addr, full,
 	db_printf);
 #endif
@@ -1003,12 +1003,12 @@ static void
 db_page_print_cmd(db_expr_t addr, bool have_addr,
 db_expr_t count, const char *modif)
 {
+#ifdef _KERNEL /* XXX CRASH(8) */
 	bool full = false;
 
 	if (modif[0] == 'f')
 		full = true;
 
-#ifdef _KERNEL /* XXX CRASH(8) */
 	uvm_page_printit((struct vm_page *)(uintptr_t) addr, full, db_printf);
 #endif
 }
@@ -1029,12 +1029,12 @@ static void
 db_buf_print_cmd(db_expr_t addr, bool have_addr,
 db_expr_t count, const char *modif)
 {
+#ifdef _KERNEL /* XXX CRASH(8) */
 	bool full = false;
 
 	if (modif[0] == 'f')
 		full = true;
 
-#ifdef _KERNEL /* XXX CRASH(8) */
 	vfs_buf_print((struct buf *)(uintptr_t) addr, full, db_printf);
 #endif
 }
@@ -1102,12 +1102,12 @@ static void
 db_vnode_print_cmd(db_expr_t addr, bool have_addr,
 db_expr_t count, const char *modif)
 {
+#ifdef _KERNEL /* XXX CRASH(8) */
 	bool full = false;
 
 	if (modif[0] == 'f')
 		full = true;
 
-#ifdef _KERNEL /* XXX CRASH(8) */
 	vfs_vnode_print((struct vnode *)(uintptr_t) addr, full, db_printf);
 #endif
 }
@@ -1127,12 +1127,12 @@ static void
 db_mount_print_cmd(db_expr_t addr, bool have_addr,
 db_expr_t count, const char *modif)
 {
+#ifdef _KERNEL	/* XXX CRASH(8) */
 	bool full = false;
 
 	if (modif[0] == 'f')
 		full = true;
 
-#ifdef _KERNEL	/* XXX CRASH(8) */
 	vfs_mount_print((struct mount *)(uintptr_t) addr, full, db_printf);
 #endif
 }



CVS commit: src/sys/netinet6

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 15:44:29 UTC 2013

Modified Files:
src/sys/netinet6: in6.h

Log Message:
define constants for scopeid function flags.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/netinet6/in6.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/netinet6/in6.h
diff -u src/sys/netinet6/in6.h:1.74 src/sys/netinet6/in6.h:1.75
--- src/sys/netinet6/in6.h:1.74	Fri Oct 18 20:09:03 2013
+++ src/sys/netinet6/in6.h	Sat Oct 19 11:44:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.h,v 1.74 2013/10/19 00:09:03 christos Exp $	*/
+/*	$NetBSD: in6.h,v 1.75 2013/10/19 15:44:29 christos Exp $	*/
 /*	$KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $	*/
 
 /*
@@ -771,6 +771,9 @@ void	in6_sin_2_v4mapsin6(struct sockaddr
 void	in6_sin6_2_sin_in_sock(struct sockaddr *);
 void	in6_sin_2_v4mapsin6_in_sock(struct sockaddr **);
 
+#define INET6_IS_ADDR_LINKLOCAL		1
+#define INET6_IS_ADDR_MC_LINKLOCAL	2
+#define INET6_IS_ADDR_SITELOCAL		4
 void	inet6_getscopeid(struct sockaddr_in6 *, int);
 void	inet6_putscopeid(struct sockaddr_in6 *, int);
 



CVS commit: src/lib/libc/net

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 15:47:02 UTC 2013

Modified Files:
src/lib/libc/net: inet6_scopeid.c

Log Message:
use new constants


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/net/inet6_scopeid.c

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

Modified files:

Index: src/lib/libc/net/inet6_scopeid.c
diff -u src/lib/libc/net/inet6_scopeid.c:1.1 src/lib/libc/net/inet6_scopeid.c:1.2
--- src/lib/libc/net/inet6_scopeid.c:1.1	Fri Oct 18 20:08:34 2013
+++ src/lib/libc/net/inet6_scopeid.c	Sat Oct 19 11:47:02 2013
@@ -34,7 +34,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: inet6_scopeid.c,v 1.1 2013/10/19 00:08:34 christos Exp $);
+__RCSID($NetBSD: inet6_scopeid.c,v 1.2 2013/10/19 15:47:02 christos Exp $);
 
 #include sys/endian.h
 #include string.h
@@ -47,8 +47,12 @@ void
 inet6_getscopeid(struct sockaddr_in6 *sin6, int flags)
 {
 #if defined(__KAME__)
-	if ((IN6_IS_ADDR_LINKLOCAL(sin6-sin6_addr)  (flags  1)) ||
-	(IN6_IS_ADDR_MC_LINKLOCAL(sin6-sin6_addr)  (flags  2))) {
+	if ((IN6_IS_ADDR_LINKLOCAL(sin6-sin6_addr) 
+	(flags  INET6_IS_ADDR_LINKLOCAL)) ||
+	(IN6_IS_ADDR_MC_LINKLOCAL(sin6-sin6_addr) 
+	(flags  INET6_IS_ADDR_MC_LINKLOCAL)) ||
+	(IN6_IS_ADDR_SITELOCAL(sin6-sin6_addr) 
+	(flags  INET6_IS_ADDR_SITELOCAL))) {
 		uint16_t scope;
 		memcpy(scope, sin6-sin6_addr.s6_addr[2], sizeof(scope));
 		sin6-sin6_scope_id = ntohs(scope);
@@ -61,8 +65,12 @@ void
 inet6_putscopeid(struct sockaddr_in6 *sin6, int flags)
 {
 #if defined(__KAME__)
-	if ((IN6_IS_ADDR_LINKLOCAL(sin6-sin6_addr)  (flags  1)) ||
-	(IN6_IS_ADDR_MC_LINKLOCAL(sin6-sin6_addr)  (flags  2))) {
+	if ((IN6_IS_ADDR_LINKLOCAL(sin6-sin6_addr) 
+	(flags  INET6_IS_ADDR_LINKLOCAL)) ||
+	(IN6_IS_ADDR_MC_LINKLOCAL(sin6-sin6_addr) 
+	(flags  INET6_IS_ADDR_MC_LINKLOCAL)) ||
+	(IN6_IS_ADDR_SITELOCAL(sin6-sin6_addr) 
+	(flags  INET6_IS_ADDR_SITELOCAL))) {
 	uint16_t scope = htons(sin6-sin6_scope_id);
 		memcpy(sin6-sin6_addr.s6_addr[2], scope, sizeof(scope));
 		sin6-sin6_scope_id = 0;



CVS commit: src/sbin

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 15:50:26 UTC 2013

Modified Files:
src/sbin/ifconfig: af_inet6.c tunnel.c
src/sbin/route: route.c

Log Message:
use symbolic flags


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sbin/ifconfig/af_inet6.c
cvs rdiff -u -r1.18 -r1.19 src/sbin/ifconfig/tunnel.c
cvs rdiff -u -r1.142 -r1.143 src/sbin/route/route.c

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

Modified files:

Index: src/sbin/ifconfig/af_inet6.c
diff -u src/sbin/ifconfig/af_inet6.c:1.28 src/sbin/ifconfig/af_inet6.c:1.29
--- src/sbin/ifconfig/af_inet6.c:1.28	Fri Oct 18 20:35:30 2013
+++ src/sbin/ifconfig/af_inet6.c	Sat Oct 19 11:50:26 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: af_inet6.c,v 1.28 2013/10/19 00:35:30 christos Exp $	*/
+/*	$NetBSD: af_inet6.c,v 1.29 2013/10/19 15:50:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: af_inet6.c,v 1.28 2013/10/19 00:35:30 christos Exp $);
+__RCSID($NetBSD: af_inet6.c,v 1.29 2013/10/19 15:50:26 christos Exp $);
 #endif /* not lint */
 
 #include sys/param.h 
@@ -278,7 +278,7 @@ in6_alias(const char *ifname, prop_dicti
 
 	sin6 = creq-ifr_addr;
 
-	inet6_getscopeid(sin6, 1);
+	inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL);
 	scopeid = sin6-sin6_scope_id;
 	if (getnameinfo((const struct sockaddr *)sin6, sin6-sin6_len,
 			hbuf, sizeof(hbuf), NULL, 0, niflag))
@@ -298,7 +298,7 @@ in6_alias(const char *ifname, prop_dicti
 			ifr6.ifr_addr.sin6_len = sizeof(struct sockaddr_in6);
 		}
 		sin6 = ifr6.ifr_addr;
-		inet6_getscopeid(sin6, 1);
+		inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL);
 		hbuf[0] = '\0';
 		if (getnameinfo((struct sockaddr *)sin6, sin6-sin6_len,
 hbuf, sizeof(hbuf), NULL, 0, niflag))
@@ -406,8 +406,8 @@ in6_pre_aifaddr(prop_dictionary_t env, c
 	setia6vltime_impl(env, ifra);
 	setia6pltime_impl(env, ifra);
 	setia6flags_impl(env, ifra);
-	inet6_putscopeid(ifra-ifra_addr, 1);
-	inet6_putscopeid(ifra-ifra_dstaddr, 1);
+	inet6_putscopeid(ifra-ifra_addr, INET6_IS_ADDR_LINKLOCAL);
+	inet6_putscopeid(ifra-ifra_dstaddr, INET6_IS_ADDR_LINKLOCAL);
 
 	return 0;
 }

Index: src/sbin/ifconfig/tunnel.c
diff -u src/sbin/ifconfig/tunnel.c:1.18 src/sbin/ifconfig/tunnel.c:1.19
--- src/sbin/ifconfig/tunnel.c:1.18	Fri Oct 18 20:35:30 2013
+++ src/sbin/ifconfig/tunnel.c	Sat Oct 19 11:50:26 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tunnel.c,v 1.18 2013/10/19 00:35:30 christos Exp $	*/
+/*	$NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: tunnel.c,v 1.18 2013/10/19 00:35:30 christos Exp $);
+__RCSID($NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $);
 #endif /* not lint */
 
 #include sys/param.h 
@@ -125,8 +125,8 @@ settunnel(prop_dictionary_t env, prop_di
 		IN6_IS_ADDR_MULTICAST(s6-sin6_addr))
 			errx(EXIT_FAILURE, tunnel src/dst is multicast);
 		/* embed scopeid */
-		inet6_putscopeid(s6, 1);
-		inet6_getscopeid(d, 1);
+		inet6_putscopeid(s6, INET6_IS_ADDR_LINKLOCAL);
+		inet6_getscopeid(d, INET6_IS_ADDR_LINKLOCAL);
 	}
 #endif /* INET6 */
 
@@ -162,7 +162,8 @@ tunnel_status(prop_dictionary_t env, pro
 	afp = lookup_af_bynum(req.addr.ss_family);
 #ifdef INET6
 	if (req.addr.ss_family == AF_INET6)
-		inet6_getscopeid((struct sockaddr_in6 *)req.addr, 1);
+		inet6_getscopeid((struct sockaddr_in6 *)req.addr,
+		INET6_IS_ADDR_LINKLOCAL);
 #endif /* INET6 */
 	getnameinfo((struct sockaddr *)req.addr, req.addr.ss_len,
 	psrcaddr, sizeof(psrcaddr), srcserv[1], sizeof(srcserv) - 1,
@@ -170,7 +171,8 @@ tunnel_status(prop_dictionary_t env, pro
 
 #ifdef INET6
 	if (req.dstaddr.ss_family == AF_INET6)
-		inet6_getscopeid((struct sockaddr_in6 *)req.dstaddr, 1);
+		inet6_getscopeid((struct sockaddr_in6 *)req.dstaddr,
+		INET6_IS_ADDR_LINKLOCAL);
 #endif
 	getnameinfo((struct sockaddr *)req.dstaddr, req.dstaddr.ss_len,
 	pdstaddr, sizeof(pdstaddr), dstserv[1], sizeof(dstserv) - 1,

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.142 src/sbin/route/route.c:1.143
--- src/sbin/route/route.c:1.142	Fri Oct 18 20:39:39 2013
+++ src/sbin/route/route.c	Sat Oct 19 11:50:26 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.142 2013/10/19 00:39:39 christos Exp $	*/
+/*	$NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)route.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: route.c,v 1.142 2013/10/19 00:39:39 christos Exp $);
+__RCSID($NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -538,7 +538,8 @@ routename(const struct sockaddr *sa, str
 		memcpy(sin6, sa, sa-sa_len);
 		sin6.sin6_len = sizeof(struct sockaddr_in6);
 		

CVS commit: src/usr.bin

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 15:56:06 UTC 2013

Modified Files:
src/usr.bin/fstat: fstat.c
src/usr.bin/netstat: if.c inet6.c show.c

Log Message:
use correct function and symbolic constants


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/usr.bin/fstat/fstat.c
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/netstat/inet6.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/netstat/show.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/fstat/fstat.c
diff -u src/usr.bin/fstat/fstat.c:1.102 src/usr.bin/fstat/fstat.c:1.103
--- src/usr.bin/fstat/fstat.c:1.102	Fri Oct 18 20:28:38 2013
+++ src/usr.bin/fstat/fstat.c	Sat Oct 19 11:56:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstat.c,v 1.102 2013/10/19 00:28:38 christos Exp $	*/
+/*	$NetBSD: fstat.c,v 1.103 2013/10/19 15:56:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = @(#)fstat.c	8.3 (Berkeley) 5/2/95;
 #else
-__RCSID($NetBSD: fstat.c,v 1.102 2013/10/19 00:28:38 christos Exp $);
+__RCSID($NetBSD: fstat.c,v 1.103 2013/10/19 15:56:05 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -904,7 +904,7 @@ inet6_addrstr(char *buf, size_t len, con
 	sin6.sin6_addr = *a;
 	sin6.sin6_port = htons(p);
 
-	inet6_putscopeid(sin6, 1);
+	inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL);
 	serv[0] = '\0';
 
 	if (getnameinfo((struct sockaddr *)sin6, sin6.sin6_len,

Index: src/usr.bin/netstat/if.c
diff -u src/usr.bin/netstat/if.c:1.78 src/usr.bin/netstat/if.c:1.79
--- src/usr.bin/netstat/if.c:1.78	Fri Oct 18 20:28:38 2013
+++ src/usr.bin/netstat/if.c	Sat Oct 19 11:56:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.78 2013/10/19 00:28:38 christos Exp $	*/
+/*	$NetBSD: if.c,v 1.79 2013/10/19 15:56:06 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = from: @(#)if.c	8.2 (Berkeley) 2/21/94;
 #else
-__RCSID($NetBSD: if.c,v 1.78 2013/10/19 00:28:38 christos Exp $);
+__RCSID($NetBSD: if.c,v 1.79 2013/10/19 15:56:06 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -399,7 +399,7 @@ print_addr(struct sockaddr *sa, struct s
 #ifdef INET6
 	case AF_INET6:
 		sin6 = (struct sockaddr_in6 *)sa;
-		inet6_putscopeid(sin6, 1);
+		inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL);
 #ifdef __KAME__
 		if (!vflag)
 			sin6-sin6_scope_id = 0;
@@ -446,7 +446,8 @@ print_addr(struct sockaddr *sa, struct s
 as6.sin6_len = sizeof(struct sockaddr_in6);
 as6.sin6_family = AF_INET6;
 as6.sin6_addr = inm.in6m_addr;
-inet6_putscopeid(as6, 2);
+inet6_getscopeid(as6,
+INET6_IS_ADDR_MC_LINKLOCAL);
 if (getnameinfo((struct sockaddr *)as6,
 as6.sin6_len, hbuf,
 sizeof(hbuf), NULL, 0,

Index: src/usr.bin/netstat/inet6.c
diff -u src/usr.bin/netstat/inet6.c:1.64 src/usr.bin/netstat/inet6.c:1.65
--- src/usr.bin/netstat/inet6.c:1.64	Fri Oct 18 20:28:38 2013
+++ src/usr.bin/netstat/inet6.c	Sat Oct 19 11:56:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: inet6.c,v 1.64 2013/10/19 00:28:38 christos Exp $	*/
+/*	$NetBSD: inet6.c,v 1.65 2013/10/19 15:56:06 christos Exp $	*/
 /*	BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp	*/
 
 /*
@@ -64,7 +64,7 @@
 #if 0
 static char sccsid[] = @(#)inet.c	8.4 (Berkeley) 4/20/94;
 #else
-__RCSID($NetBSD: inet6.c,v 1.64 2013/10/19 00:28:38 christos Exp $);
+__RCSID($NetBSD: inet6.c,v 1.65 2013/10/19 15:56:06 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -1420,7 +1420,8 @@ inet6name(const struct in6_addr *in6p)
 		sin6.sin6_len = sizeof(sin6);
 		sin6.sin6_family = AF_INET6;
 		sin6.sin6_addr = *in6p;
-		inet6_putscopeid(sin6, 3);
+		inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL|
+		INET6_IS_ADDR_MC_LINKLOCAL);
 		if (getnameinfo((struct sockaddr *)sin6, sin6.sin6_len,
 hbuf, sizeof(hbuf), NULL, 0, niflag) != 0)
 			strlcpy(hbuf, ?, sizeof(hbuf));

Index: src/usr.bin/netstat/show.c
diff -u src/usr.bin/netstat/show.c:1.17 src/usr.bin/netstat/show.c:1.18
--- src/usr.bin/netstat/show.c:1.17	Fri Oct 18 20:28:38 2013
+++ src/usr.bin/netstat/show.c	Sat Oct 19 11:56:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: show.c,v 1.17 2013/10/19 00:28:38 christos Exp $	*/
+/*	$NetBSD: show.c,v 1.18 2013/10/19 15:56:06 christos Exp $	*/
 /*	$OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $	*/
 
 /*
@@ -331,11 +331,8 @@ p_sockaddr(struct sockaddr *sa, struct s
 	{
 		struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
 
-		/*
-		 * XXX: This is a special workaround for KAME kernels.
-		 * sin6_scope_id field of SA should be set in the future.
-		 */
-		inet6_putscopeid(sa6, 3);
+		inet6_getscopeid(sa6, INET6_IS_ADDR_LINKLOCAL|
+		INET6_IS_ADDR_MC_LINKLOCAL);
 		if (flags  RTF_HOST)
 			cp = routename((struct sockaddr *)sa6);
 		else
@@ -426,7 +423,8 @@ routename(struct sockaddr *sa)
 		

CVS commit: src/sbin

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 15:59:15 UTC 2013

Modified Files:
src/sbin/ifconfig: tunnel.c
src/sbin/route: route.c

Log Message:
use correct function


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sbin/ifconfig/tunnel.c
cvs rdiff -u -r1.143 -r1.144 src/sbin/route/route.c

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

Modified files:

Index: src/sbin/ifconfig/tunnel.c
diff -u src/sbin/ifconfig/tunnel.c:1.19 src/sbin/ifconfig/tunnel.c:1.20
--- src/sbin/ifconfig/tunnel.c:1.19	Sat Oct 19 11:50:26 2013
+++ src/sbin/ifconfig/tunnel.c	Sat Oct 19 11:59:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $	*/
+/*	$NetBSD: tunnel.c,v 1.20 2013/10/19 15:59:15 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $);
+__RCSID($NetBSD: tunnel.c,v 1.20 2013/10/19 15:59:15 christos Exp $);
 #endif /* not lint */
 
 #include sys/param.h 
@@ -126,7 +126,7 @@ settunnel(prop_dictionary_t env, prop_di
 			errx(EXIT_FAILURE, tunnel src/dst is multicast);
 		/* embed scopeid */
 		inet6_putscopeid(s6, INET6_IS_ADDR_LINKLOCAL);
-		inet6_getscopeid(d, INET6_IS_ADDR_LINKLOCAL);
+		inet6_putscopeid(d, INET6_IS_ADDR_LINKLOCAL);
 	}
 #endif /* INET6 */
 

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.143 src/sbin/route/route.c:1.144
--- src/sbin/route/route.c:1.143	Sat Oct 19 11:50:26 2013
+++ src/sbin/route/route.c	Sat Oct 19 11:59:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $	*/
+/*	$NetBSD: route.c,v 1.144 2013/10/19 15:59:15 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)route.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $);
+__RCSID($NetBSD: route.c,v 1.144 2013/10/19 15:59:15 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -696,7 +696,7 @@ netname(const struct sockaddr *sa, struc
 		memcpy(sin6, sa, sa-sa_len);
 		sin6.sin6_len = sizeof(struct sockaddr_in6);
 		sin6.sin6_family = AF_INET6;
-		inet6_putscopeid(sin6, INET6_IS_ADDR_LINKLOCAL|
+		inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL|
 		INET6_IS_ADDR_MC_LINKLOCAL);
 		nml = netmask_length(nm, AF_INET6);
 		if (IN6_IS_ADDR_UNSPECIFIED(sin6.sin6_addr)) {
@@ -1237,7 +1237,7 @@ getaddr(int which, const char *s, struct
 		}
 		memcpy(su-sin6, res-ai_addr, sizeof(su-sin6));
 		freeaddrinfo(res);
-		inet6_getscopeid(su-sin6, INET6_IS_ADDR_LINKLOCAL|
+		inet6_putscopeid(su-sin6, INET6_IS_ADDR_LINKLOCAL|
 		INET6_IS_ADDR_MC_LINKLOCAL);
 		if (hints.ai_flags == AI_NUMERICHOST) {
 			if (slash)



CVS commit: src/sys/arch/mac68k/dev

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 16:19:13 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: adb_direct.c

Log Message:
Make sure we don't accidently pass an unsolicited packet as ack only
(which would dereference unitialized pointers)


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mac68k/dev/adb_direct.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/mac68k/dev/adb_direct.c
diff -u src/sys/arch/mac68k/dev/adb_direct.c:1.64 src/sys/arch/mac68k/dev/adb_direct.c:1.65
--- src/sys/arch/mac68k/dev/adb_direct.c:1.64	Fri Oct 18 18:38:49 2013
+++ src/sys/arch/mac68k/dev/adb_direct.c	Sat Oct 19 16:19:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_direct.c,v 1.64 2013/10/18 18:38:49 martin Exp $	*/
+/*	$NetBSD: adb_direct.c,v 1.65 2013/10/19 16:19:13 martin Exp $	*/
 
 /* From: adb_direct.c 2.02 4/18/97 jpw */
 
@@ -62,7 +62,7 @@
 #ifdef __NetBSD__
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: adb_direct.c,v 1.64 2013/10/18 18:38:49 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: adb_direct.c,v 1.65 2013/10/19 16:19:13 martin Exp $);
 
 #include opt_adb.h
 
@@ -1693,6 +1693,8 @@ adb_pass_up(struct adbCommand *in)
  	 * the caller sent us.
  	 */
 	if (in-unsol) {
+		if (in-ack_only) panic(invalid ack-only pkg);
+
 		adbInbound[adbInTail].compRout = (void *)block.dbServiceRtPtr;
 		adbInbound[adbInTail].compData = (void *)block.dbDataAreaAddr;
 		adbInbound[adbInTail].saveBuf = (void *)adbInbound[adbInTail].data;



CVS commit: src/sys/arch/mac68k/dev

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 16:21:57 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: aed.c

Log Message:
comment out unused code (for documentation purposes)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/mac68k/dev/aed.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/mac68k/dev/aed.c
diff -u src/sys/arch/mac68k/dev/aed.c:1.30 src/sys/arch/mac68k/dev/aed.c:1.31
--- src/sys/arch/mac68k/dev/aed.c:1.30	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/aed.c	Sat Oct 19 16:21:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: aed.c,v 1.30 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: aed.c,v 1.31 2013/10/19 16:21:57 martin Exp $	*/
 
 /*
  * Copyright (C) 1994	Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aed.c,v 1.30 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: aed.c,v 1.31 2013/10/19 16:21:57 martin Exp $);
 
 #include opt_adb.h
 
@@ -539,11 +539,8 @@ aedioctl(dev_t dev, u_long cmd, void *da
 		/* Do nothing for now */
 		break;
 
-	case ADBIOC_LISTENCMD:{
-		adb_listencmd_t *lc;
-
-		lc = (void *)data;
-	}
+	case ADBIOC_LISTENCMD:
+		/* adb_listencmd_t *lc = data; */
 
 	default:
 		return (EINVAL);



CVS commit: src/sys/arch/mac68k/dev

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 16:23:17 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: ams.c

Log Message:
Mark a potentially unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mac68k/dev/ams.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/mac68k/dev/ams.c
diff -u src/sys/arch/mac68k/dev/ams.c:1.21 src/sys/arch/mac68k/dev/ams.c:1.22
--- src/sys/arch/mac68k/dev/ams.c:1.21	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/ams.c	Sat Oct 19 16:23:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ams.c,v 1.21 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: ams.c,v 1.22 2013/10/19 16:23:17 martin Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ams.c,v 1.21 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: ams.c,v 1.22 2013/10/19 16:23:17 martin Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -106,7 +106,7 @@ amsattach(device_t parent, device_t self
 	ADBSetInfoBlock adbinfo;
 	struct ams_softc *sc = device_private(self);
 	struct adb_attach_args * aa_args = (struct adb_attach_args *)aux;
-	int error;
+	int error __unused;
 #if NWSMOUSE  0
 	struct wsmousedev_attach_args a;
 #endif



CVS commit: src/sys/ufs/ffs

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 16:30:57 UTC 2013

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

Log Message:
Mark a potentially unused (ifndef FFS_EI) variable


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 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.129 src/sys/ufs/ffs/ffs_snapshot.c:1.130
--- src/sys/ufs/ffs/ffs_snapshot.c:1.129	Mon Sep 30 18:58:00 2013
+++ src/sys/ufs/ffs/ffs_snapshot.c	Sat Oct 19 16:30:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_snapshot.c,v 1.129 2013/09/30 18:58:00 hannken Exp $	*/
+/*	$NetBSD: ffs_snapshot.c,v 1.130 2013/10/19 16:30:57 martin Exp $	*/
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.129 2013/09/30 18:58:00 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.130 2013/10/19 16:30:57 martin Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -1727,7 +1727,7 @@ ffs_snapshot_mount(struct mount *mp)
 	struct inode *ip, *xp;
 	struct snap_info *si;
 	daddr_t snaplistsize, *snapblklist;
-	int i, error, ns, snaploc, loc;
+	int i, error, ns __unused, snaploc, loc;
 
 	/*
 	 * No persistent snapshots on apple ufs file systems.



CVS commit: src/sys/miscfs/genfs

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 16:33:11 UTC 2013

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
Mark a potentially unused (if an arch implements pmap_update as empty
macro) variable accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.55 src/sys/miscfs/genfs/genfs_io.c:1.56
--- src/sys/miscfs/genfs/genfs_io.c:1.55	Tue May 22 14:20:39 2012
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Oct 19 16:33:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.55 2012/05/22 14:20:39 yamt Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.56 2013/10/19 16:33:11 martin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.55 2012/05/22 14:20:39 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.56 2013/10/19 16:33:11 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1727,7 +1727,7 @@ genfs_do_directio(struct vmspace *vs, va
 off_t off, enum uio_rw rw)
 {
 	struct vm_map *map;
-	struct pmap *upm, *kpm;
+	struct pmap *upm, *kpm __unused;
 	size_t klen = round_page(uva + len) - trunc_page(uva);
 	off_t spoff, epoff;
 	vaddr_t kva, puva;



CVS commit: src/sbin/mount_lfs

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:04:41 UTC 2013

Modified Files:
src/sbin/mount_lfs: mount_lfs.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sbin/mount_lfs/mount_lfs.c

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

Modified files:

Index: src/sbin/mount_lfs/mount_lfs.c
diff -u src/sbin/mount_lfs/mount_lfs.c:1.35 src/sbin/mount_lfs/mount_lfs.c:1.36
--- src/sbin/mount_lfs/mount_lfs.c:1.35	Fri Oct 18 21:09:58 2013
+++ src/sbin/mount_lfs/mount_lfs.c	Sat Oct 19 13:04:41 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_lfs.c,v 1.35 2013/10/19 01:09:58 christos Exp $	*/
+/*	$NetBSD: mount_lfs.c,v 1.36 2013/10/19 17:04:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1993, 19
 #if 0
 static char sccsid[] = @(#)mount_lfs.c	8.4 (Berkeley) 4/26/95;
 #else
-__RCSID($NetBSD: mount_lfs.c,v 1.35 2013/10/19 01:09:58 christos Exp $);
+__RCSID($NetBSD: mount_lfs.c,v 1.36 2013/10/19 17:04:41 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -151,7 +151,7 @@ mount_lfs(int argc, char *argv[])
 {
 	struct ufs_args args;
 	int mntflags;
-	int mntsize, oldflags, i;
+	int mntsize, i;
 	char fs_name[MAXPATHLEN], canon_dev[MAXPATHLEN];
 	struct statvfs *mntbuf;
 	const char *errcause;
@@ -163,13 +163,11 @@ mount_lfs(int argc, char *argv[])
 	 * performing the mount, so we can know whether to start or
 	 * kill the cleaner process below.
 	 */
-	oldflags = MNT_RDONLY; /* If not mounted, pretend r/o */
 	if (mntflags  MNT_UPDATE) {
 		if ((mntsize = getmntinfo(mntbuf, MNT_NOWAIT)) == 0)
 			err(1, getmntinfo);
 		for (i = 0; i  mntsize; i++) {
 			if (strcmp(mntbuf[i].f_mntfromname, args.fspec) == 0) {
-oldflags = mntbuf[i].f_flag;
 break;
 			}
 		}



CVS commit: src/usr.sbin/cnwctl

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:05:58 UTC 2013

Modified Files:
src/usr.sbin/cnwctl: cnwctl.c

Log Message:
avoid pointer gymnastics


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/cnwctl/cnwctl.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.sbin/cnwctl/cnwctl.c
diff -u src/usr.sbin/cnwctl/cnwctl.c:1.7 src/usr.sbin/cnwctl/cnwctl.c:1.8
--- src/usr.sbin/cnwctl/cnwctl.c:1.7	Fri May  2 15:59:19 2008
+++ src/usr.sbin/cnwctl/cnwctl.c	Sat Oct 19 13:05:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cnwctl.c,v 1.7 2008/05/02 19:59:19 xtraeme Exp $	*/
+/*	$NetBSD: cnwctl.c,v 1.8 2013/10/19 17:05:58 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Berkeley Software Design, Inc.
@@ -210,8 +210,10 @@ main(int argc, char **argv)
 		cnws.data[0x58]);
 		printf(  0x%02x mhs\n,
 		cnws.data[0x6b]);
-		printf( %04x %04x revision\n,
-		*(u_short *)cnws.data[0x66], *(u_short *)cnws.data[0x68]);
+		u_short x, y;
+		memcpy(x, cnws.data[0x66], sizeof(x));
+		memcpy(y, cnws.data[0x68], sizeof(y));
+		printf( %04x %04x revision\n, x, y);
 		printf(%c%c id\n,
 		cnws.data[0x6e], cnws.data[0x6f]);
 	}



CVS commit: src/usr.sbin/fwctl

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:06:57 UTC 2013

Modified Files:
src/usr.sbin/fwctl: fwdv.c

Log Message:
move all the code that is unused inside #if 0


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/fwctl/fwdv.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.sbin/fwctl/fwdv.c
diff -u src/usr.sbin/fwctl/fwdv.c:1.7 src/usr.sbin/fwctl/fwdv.c:1.8
--- src/usr.sbin/fwctl/fwdv.c:1.7	Sun Feb  6 20:37:12 2011
+++ src/usr.sbin/fwctl/fwdv.c	Sat Oct 19 13:06:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwdv.c,v 1.7 2011/02/07 01:37:12 dholland Exp $	*/
+/*	$NetBSD: fwdv.c,v 1.8 2013/10/19 17:06:57 christos Exp $	*/
 /*
  * Copyright (C) 2003
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -265,7 +265,7 @@ dvsend(int d, const char *filename, char
 	struct dvdbc *dv;
 	struct fw_pkt *pkt;
 	int len, tlen, header, fd, frames, packets, vec, offset, nhdr, i;
-	int lsystem=-1, pad_acc, cycle_acc, cycle, f_cycle, f_frac;
+	int lsystem=-1, pad_acc, cycle_acc, cycle, f_frac;
 	struct iovec wbuf[TNBUF*2 + NEMPTY];
 	char *pbuf;
 	uint32_t iso_data, iso_empty, hdr[TNBUF + NEMPTY][3];
@@ -368,10 +368,11 @@ next:
 			if (frames % frame_rate[lsystem] == 0)
 fprintf(stderr, \n);
 			fflush(stderr);
-			f_cycle = (cycle_acc / frame_cycle[lsystem].d)  0xf;
 			f_frac = (cycle_acc % frame_cycle[lsystem].d
 	* CYCLE_FRAC) / frame_cycle[lsystem].d;
 #if 0
+			int f_cycle = (cycle_acc / frame_cycle[lsystem].d)
+			 0xf;
 			ciph-fdf.dv.cyc = htons(f_cycle  12 | f_frac);
 #else
 			ciph-fdf.dv.cyc = htons(cycle  12 | f_frac);



CVS commit: src/usr.sbin/installboot/arch

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:08:15 UTC 2013

Modified Files:
src/usr.sbin/installboot/arch: landisk.c

Log Message:
move all the unused code inside #if 0


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/installboot/arch/landisk.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.sbin/installboot/arch/landisk.c
diff -u src/usr.sbin/installboot/arch/landisk.c:1.5 src/usr.sbin/installboot/arch/landisk.c:1.6
--- src/usr.sbin/installboot/arch/landisk.c:1.5	Thu May  7 03:03:39 2009
+++ src/usr.sbin/installboot/arch/landisk.c	Sat Oct 19 13:08:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: landisk.c,v 1.5 2009/05/07 07:03:39 lukem Exp $	*/
+/*	$NetBSD: landisk.c,v 1.6 2013/10/19 17:08:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include sys/cdefs.h
 #if !defined(__lint)
-__RCSID($NetBSD: landisk.c,v 1.5 2009/05/07 07:03:39 lukem Exp $);
+__RCSID($NetBSD: landisk.c,v 1.6 2013/10/19 17:08:15 christos Exp $);
 #endif /* !__lint */
 
 #include sys/param.h
@@ -68,7 +68,6 @@ landisk_setboot(ib_params *params)
 	size_t bootstrapsize;
 	int retval, i;
 	uint32_t bplen;
-	int bpbsize;
 
 	assert(params != NULL);
 	assert(params-fsfd != -1);
@@ -149,11 +148,11 @@ landisk_setboot(ib_params *params)
 	 *	2b a0 11	jmp ENDOF(mbr_bpbFAT32)+1, nop
 	 *  (anything else)	; don't preserve
 	 */
-	bpbsize = 0;
 #if 0
+	int bpbsize;
 	if (bootstrapbuf[1] == 0xa0  bootstrapbuf[2] == 0x11 
 	(bootstrapbuf[0] == 0x2b /*|| bootstrapbuf[0] == 0x1d*/)) {
-		bpbsize = bootstrapbuf[0] + 2 - MBR_BPB_OFFSET;
+		 bpbsize = bootstrapbuf[0] + 2 - MBR_BPB_OFFSET;
 	}
 #endif
 



CVS commit: src/usr.sbin/lockstat

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:10:17 UTC 2013

Modified Files:
src/usr.sbin/lockstat: elf32.c

Log Message:
move all the necessay code inside ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/lockstat/elf32.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.sbin/lockstat/elf32.c
diff -u src/usr.sbin/lockstat/elf32.c:1.9 src/usr.sbin/lockstat/elf32.c:1.10
--- src/usr.sbin/lockstat/elf32.c:1.9	Sat Feb  5 08:32:32 2011
+++ src/usr.sbin/lockstat/elf32.c	Sat Oct 19 13:10:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf32.c,v 1.9 2011/02/05 13:32:32 yamt Exp $	*/
+/*	$NetBSD: elf32.c,v 1.10 2013/10/19 17:10:17 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include sys/cdefs.h
 #if !defined(lint)
-__RCSID($NetBSD: elf32.c,v 1.9 2011/02/05 13:32:32 yamt Exp $);
+__RCSID($NetBSD: elf32.c,v 1.10 2013/10/19 17:10:17 christos Exp $);
 #endif
 
 #ifndef ELFSIZE
@@ -166,9 +166,8 @@ NAME(loadsym)(int fd)
 int
 NAME(findsym)(findsym_t find, char *name, uintptr_t *start, uintptr_t *end)
 {
-	static int lastptr[FIND_MAX];
 	uintptr_t sa, ea;
-	int i, rv, off;
+	int i, off;
 	Elf_Byte st;
 
 	switch (find) {
@@ -184,9 +183,9 @@ NAME(findsym)(findsym_t find, char *name
 		return -1;
 	}
 
-	rv = -1;
 
 #ifdef dump_core
+	static int lastptr[FIND_MAX];
 	for (i = lastptr[find];;) {
 #else
 	for (i = 0; i  nsyms; i++) {
@@ -239,6 +238,8 @@ NAME(findsym)(findsym_t find, char *name
 	return -1;
 
  found:
+#ifdef dump_core
  	lastptr[find] = i;
+#endif
  	return 0;
 }



CVS commit: src/usr.sbin/isdn/isdntrace

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:09:38 UTC 2013

Modified Files:
src/usr.sbin/isdn/isdntrace: trace.c

Log Message:
using sizeof(char *) to compute the size of a buffer is not going to work
very well.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/isdn/isdntrace/trace.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.sbin/isdn/isdntrace/trace.c
diff -u src/usr.sbin/isdn/isdntrace/trace.c:1.13 src/usr.sbin/isdn/isdntrace/trace.c:1.14
--- src/usr.sbin/isdn/isdntrace/trace.c:1.13	Wed Aug 31 12:24:59 2011
+++ src/usr.sbin/isdn/isdntrace/trace.c	Sat Oct 19 13:09:38 2013
@@ -35,7 +35,7 @@
  *	trace.c - print traces of D (B) channel activity for isdn4bsd
  *	-
  *
- *	$Id: trace.c,v 1.13 2011/08/31 16:24:59 plunky Exp $ 
+ *	$Id: trace.c,v 1.14 2013/10/19 17:09:38 christos Exp $ 
  *
  * $FreeBSD$
  *
@@ -80,7 +80,7 @@ static int switch_driver( int value, int
 __dead static void usage( void );
 static void exit_hdl( void );
 static void reopenfiles( int );
-void add_datetime(char *filename, char *rfilename);
+void add_datetime(const char *filename, char *rfilename, size_t);
 char * fmt_hdr(struct i4b_trace_hdr *hdr, int frm_len);
 
 /*---*
@@ -242,7 +242,7 @@ main(int argc, char *argv[])
 			snprintf(BPfilename, sizeof(BPfilename), %s%d,
 			BIN_FILE_NAME, unit);
 			
-		add_datetime(BPfilename, rBPfilename);
+		add_datetime(BPfilename, rBPfilename, sizeof(rBPfilename));
 
 		if ((BP = fopen(rBPfilename, w)) == NULL)
 		{
@@ -321,7 +321,7 @@ main(int argc, char *argv[])
 		else
 			strlcpy(outfilename, outfile, sizeof(outfilename));
 			
-		add_datetime(outfilename, routfilename);
+		add_datetime(outfilename, routfilename, sizeof(routfilename));
 			
 		if ((Fout = fopen(routfilename, w)) == NULL)
 		{
@@ -777,7 +777,7 @@ reopenfiles(int dummy)
 	{
 		fclose(Fout);
 
-		add_datetime(outfilename, routfilename);
+		add_datetime(outfilename, routfilename, sizeof(routfilename));
 		
 		if ((Fout = fopen(routfilename, a)) == NULL)
 		{
@@ -806,7 +806,7 @@ reopenfiles(int dummy)
 		
 		fclose(BP);
 
-		add_datetime(BPfilename, rBPfilename);
+		add_datetime(BPfilename, rBPfilename, sizeof(rBPfilename));
 		
 		if ((BP = fopen(rBPfilename, a)) == NULL)
 		{
@@ -832,19 +832,21 @@ reopenfiles(int dummy)
 }
 
 void
-add_datetime(char *filename, char *rfilename)
+add_datetime(const char *filename, char *rfilename, size_t len)
 {
 	time_t timeb;
-	struct tm *tmp;
 	FILE *fx;
+	int c;
+	struct tm *tmp;
 
 	time(timeb);
 	tmp = localtime(timeb);
 	
-	snprintf(rfilename, sizeof(rfilename), %s-, filename);
+	c = snprintf(rfilename, len, %s-, filename);
+	if (c  0)
+		return;
 
-	strftime(rfilename+strlen(rfilename), MAXPATHLEN-strlen(rfilename)-1,
-		%Y%m%d-%H%M%S, tmp);
+	strftime(rfilename + c, len - c - 1, %Y%m%d-%H%M%S, tmp);
 		
 	if ((fx = fopen(rfilename, r)) != NULL)
 	{
@@ -855,10 +857,11 @@ add_datetime(char *filename, char *rfile
 		time(timeb);
 		tmp = localtime(timeb);
 	
-		snprintf(rfilename, sizeof(rfilename), %s-, filename);
+		c = snprintf(rfilename, len, %s-, filename);
+		if (c  0)
+			return;
 
-		strftime(rfilename+strlen(rfilename), MAXPATHLEN-strlen(rfilename)-1,
-			%Y%m%d-%H%M%S, tmp);
+		strftime(rfilename, len - c - 1, %Y%m%d-%H%M%S, tmp);
 	}
 }
 	



CVS commit: src/usr.sbin

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:16:25 UTC 2013

Modified Files:
src/usr.sbin/faithd: faithd.c
src/usr.sbin/ifmcstat: ifmcstat.c
src/usr.sbin/lpr/common_source: common.c
src/usr.sbin/ndp: ndp.c
src/usr.sbin/rpcbind: util.c

Log Message:
use new scopeid functions


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/faithd/faithd.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/ifmcstat/ifmcstat.c
cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/lpr/common_source/common.c
cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/ndp/ndp.c
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/rpcbind/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.sbin/faithd/faithd.c
diff -u src/usr.sbin/faithd/faithd.c:1.35 src/usr.sbin/faithd/faithd.c:1.36
--- src/usr.sbin/faithd/faithd.c:1.35	Fri Sep 16 11:39:37 2011
+++ src/usr.sbin/faithd/faithd.c	Sat Oct 19 13:16:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: faithd.c,v 1.35 2011/09/16 15:39:37 joerg Exp $	*/
+/*	$NetBSD: faithd.c,v 1.36 2013/10/19 17:16:25 christos Exp $	*/
 /*	$KAME: faithd.c,v 1.62 2003/08/19 21:20:33 itojun Exp $	*/
 
 /*
@@ -751,7 +751,6 @@ grab_myaddrs(void)
 {
 	struct ifaddrs *ifap, *ifa;
 	struct myaddrs *p;
-	struct sockaddr_in6 *sin6;
 
 	if (getifaddrs(ifap) != 0) {
 		exit_failure(getifaddrs);
@@ -776,19 +775,11 @@ grab_myaddrs(void)
 		memcpy(p + 1, ifa-ifa_addr, ifa-ifa_addr-sa_len);
 		p-next = myaddrs;
 		p-addr = (void *)(p + 1);
-#ifdef __KAME__
 		if (ifa-ifa_addr-sa_family == AF_INET6) {
-			sin6 = (void *)p-addr;
-			if (IN6_IS_ADDR_LINKLOCAL(sin6-sin6_addr)
-			 || IN6_IS_ADDR_SITELOCAL(sin6-sin6_addr)) {
-sin6-sin6_scope_id =
-ntohs(*(uint16_t *)(void *)
-sin6-sin6_addr.s6_addr[3]);
-sin6-sin6_addr.s6_addr[2] = 0;
-sin6-sin6_addr.s6_addr[3] = 0;
-			}
+			struct sockaddr_in6 *sin6 = (void *)p-addr;
+			inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL|
+INET6_IS_ADDR_SITELOCAL);
 		}
-#endif
 		myaddrs = p;
 		if (dflag) {
 			char hbuf[NI_MAXHOST];

Index: src/usr.sbin/ifmcstat/ifmcstat.c
diff -u src/usr.sbin/ifmcstat/ifmcstat.c:1.11 src/usr.sbin/ifmcstat/ifmcstat.c:1.12
--- src/usr.sbin/ifmcstat/ifmcstat.c:1.11	Fri Oct 26 12:52:52 2012
+++ src/usr.sbin/ifmcstat/ifmcstat.c	Sat Oct 19 13:16:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifmcstat.c,v 1.11 2012/10/26 16:52:52 seanb Exp $	*/
+/*	$NetBSD: ifmcstat.c,v 1.12 2013/10/19 17:16:25 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -110,21 +110,14 @@ const char *inet6_n2a(p)
 {
 	static char buf[NI_MAXHOST];
 	struct sockaddr_in6 sin6;
-	u_int32_t scopeid;
 	const int niflags = NI_NUMERICHOST;
 
 	memset(sin6, 0, sizeof(sin6));
 	sin6.sin6_family = AF_INET6;
 	sin6.sin6_len = sizeof(struct sockaddr_in6);
 	sin6.sin6_addr = *p;
-	if (IN6_IS_ADDR_LINKLOCAL(p) || IN6_IS_ADDR_MC_LINKLOCAL(p)) {
-		scopeid = ntohs(*(u_int16_t *)sin6.sin6_addr.s6_addr[2]);
-		if (scopeid) {
-			sin6.sin6_scope_id = scopeid;
-			sin6.sin6_addr.s6_addr[2] = 0;
-			sin6.sin6_addr.s6_addr[3] = 0;
-		}
-	}
+	inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL|
+	INET6_IS_ADDR_MC_LINKLOCAL);
 	if (getnameinfo((struct sockaddr *)sin6, sin6.sin6_len,
 			buf, sizeof(buf), NULL, 0, niflags) == 0)
 		return buf;

Index: src/usr.sbin/lpr/common_source/common.c
diff -u src/usr.sbin/lpr/common_source/common.c:1.40 src/usr.sbin/lpr/common_source/common.c:1.41
--- src/usr.sbin/lpr/common_source/common.c:1.40	Mon Jul 13 15:05:41 2009
+++ src/usr.sbin/lpr/common_source/common.c	Sat Oct 19 13:16:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.c,v 1.40 2009/07/13 19:05:41 roy Exp $	*/
+/*	$NetBSD: common.c,v 1.41 2013/10/19 17:16:25 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)common.c	8.5 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: common.c,v 1.40 2009/07/13 19:05:41 roy Exp $);
+__RCSID($NetBSD: common.c,v 1.41 2013/10/19 17:16:25 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -396,27 +396,15 @@ checkremote(void)
 		rname, sizeof(rname), NULL, 0, niflags) != 0)
 			continue;
 		for (ifa = ifap; ifa; ifa = ifa-ifa_next) {
-#ifdef __KAME__
 			sin6p = (struct sockaddr_in6 *)ifa-ifa_addr;
 			if (ifa-ifa_addr-sa_family == AF_INET6 
-			ifa-ifa_addr-sa_len == sizeof(sin6) 
-			IN6_IS_ADDR_LINKLOCAL(sin6p-sin6_addr) 
-			*(u_int16_t *)sin6p-sin6_addr.s6_addr[2]) {
-/* kame scopeid hack */
-memcpy(sin6, ifa-ifa_addr, sizeof(sin6));
-sin6.sin6_scope_id =
-ntohs(*(u_int16_t *)sin6p-sin6_addr.s6_addr[2]);
-sin6.sin6_addr.s6_addr[2] = 0;
-sin6.sin6_addr.s6_addr[3] = 0;
+			ifa-ifa_addr-sa_len == sizeof(sin6)) {
+			inet6_getscopeid(sin6p, 3);
 if (getnameinfo((struct sockaddr *)sin6,
 sin6.sin6_len, lname, sizeof(lname),
 NULL, 0, niflags) != 0)
 	continue;
-			} else
-#endif
-			

CVS commit: src/usr.sbin

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:16:38 UTC 2013

Modified Files:
src/usr.sbin/acpitools/aml: aml_common.c aml_parse.c
src/usr.sbin/altq/altqstat: quip_client.c
src/usr.sbin/altq/libaltq: qop_cbq.c qop_hfsc.c qop_jobs.c qop_priq.c
quip_server.c
src/usr.sbin/bootp/bootptest: print-bootp.c
src/usr.sbin/makefs: cd9660.c udf.c
src/usr.sbin/makefs/cd9660: cd9660_debug.c cd9660_write.c
src/usr.sbin/makefs/ffs: mkfs.c
src/usr.sbin/makefs/msdos: msdosfs_denode.c msdosfs_vnops.c
src/usr.sbin/mmcformat: mmcformat.c
src/usr.sbin/mopd/mopd: process.c
src/usr.sbin/mopd/mopprobe: mopprobe.c
src/usr.sbin/mountd: mountd.c
src/usr.sbin/moused: moused.c
src/usr.sbin/pf/pfs: parse.y
src/usr.sbin/pppd/pppd: tdb.c
src/usr.sbin/pstat: pstat.c
src/usr.sbin/quot: quot.c
src/usr.sbin/rpcbind: pmap_svc.c rpcbind.c
src/usr.sbin/rtsold: rtsold.c
src/usr.sbin/sliplogin: sliplogin.c
src/usr.sbin/sunlabel: sunlabel.c
src/usr.sbin/ypserv/mknetid: mknetid.c

Log Message:
fix unused variable warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/acpitools/aml/aml_common.c \
src/usr.sbin/acpitools/aml/aml_parse.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/altq/altqstat/quip_client.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/altq/libaltq/qop_cbq.c \
src/usr.sbin/altq/libaltq/qop_hfsc.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/altq/libaltq/qop_jobs.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/altq/libaltq/qop_priq.c \
src/usr.sbin/altq/libaltq/quip_server.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/bootp/bootptest/print-bootp.c
cvs rdiff -u -r1.44 -r1.45 src/usr.sbin/makefs/cd9660.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/makefs/udf.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/makefs/cd9660/cd9660_debug.c
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/makefs/cd9660/cd9660_write.c
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/makefs/ffs/mkfs.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/msdos/msdosfs_denode.c
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/makefs/msdos/msdosfs_vnops.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/mmcformat/mmcformat.c
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/mopd/mopd/process.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/mopd/mopprobe/mopprobe.c
cvs rdiff -u -r1.124 -r1.125 src/usr.sbin/mountd/mountd.c
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/moused/moused.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/pf/pfs/parse.y
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/pppd/pppd/tdb.c
cvs rdiff -u -r1.120 -r1.121 src/usr.sbin/pstat/pstat.c
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/quot/quot.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/rpcbind/pmap_svc.c
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/rpcbind/rpcbind.c
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/rtsold/rtsold.c
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sliplogin/sliplogin.c
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sunlabel/sunlabel.c
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/ypserv/mknetid/mknetid.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.sbin/acpitools/aml/aml_common.c
diff -u src/usr.sbin/acpitools/aml/aml_common.c:1.3 src/usr.sbin/acpitools/aml/aml_common.c:1.4
--- src/usr.sbin/acpitools/aml/aml_common.c:1.3	Sun May 29 21:15:30 2011
+++ src/usr.sbin/acpitools/aml/aml_common.c	Sat Oct 19 13:16:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: aml_common.c,v 1.3 2011/05/30 01:15:30 dyoung Exp $	*/
+/*	$NetBSD: aml_common.c,v 1.4 2013/10/19 17:16:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 Takanori Watanabe
@@ -30,7 +30,7 @@
  *	$FreeBSD: src/usr.sbin/acpi/amldb/aml/aml_common.c,v 1.6 2000/11/09 06:24:45 iwasaki Exp $
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: aml_common.c,v 1.3 2011/05/30 01:15:30 dyoung Exp $);
+__RCSID($NetBSD: aml_common.c,v 1.4 2013/10/19 17:16:37 christos Exp $);
 
 #include sys/param.h
 
@@ -537,10 +537,8 @@ aml_region_handle_alloc(struct aml_envir
 struct aml_region_handle *h)
 {
 	int	state;
-	struct	aml_name *pci_info;
 
 	state = 0;
-	pci_info = NULL;
 	bzero(h, sizeof(struct aml_region_handle));
 
 	h-env = env;
Index: src/usr.sbin/acpitools/aml/aml_parse.c
diff -u src/usr.sbin/acpitools/aml/aml_parse.c:1.3 src/usr.sbin/acpitools/aml/aml_parse.c:1.4
--- src/usr.sbin/acpitools/aml/aml_parse.c:1.3	Tue Jun 21 05:36:46 2011
+++ src/usr.sbin/acpitools/aml/aml_parse.c	Sat Oct 19 13:16:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: aml_parse.c,v 1.3 2011/06/21 09:36:46 mrg Exp $	*/
+/*	$NetBSD: aml_parse.c,v 1.4 2013/10/19 17:16:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 Doug Rabson
@@ -30,7 +30,7 @@
  *	$FreeBSD: src/usr.sbin/acpi/amldb/aml/aml_parse.c,v 1.7 2001/10/23 14:54:15 takawata Exp $
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: aml_parse.c,v 1.3 2011/06/21 09:36:46 mrg Exp $);
+__RCSID($NetBSD: aml_parse.c,v 1.4 2013/10/19 17:16:37 christos 

CVS commit: src/libexec

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:19:30 UTC 2013

Modified Files:
src/libexec/ld.elf_so: rtld.c
src/libexec/lfs_cleanerd: lfs_cleanerd.c

Log Message:
fix unused variable warnings


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/libexec/ld.elf_so/rtld.c
cvs rdiff -u -r1.36 -r1.37 src/libexec/lfs_cleanerd/lfs_cleanerd.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.169 src/libexec/ld.elf_so/rtld.c:1.170
--- src/libexec/ld.elf_so/rtld.c:1.169	Thu May  9 11:47:34 2013
+++ src/libexec/ld.elf_so/rtld.c	Sat Oct 19 13:19:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.169 2013/05/09 15:47:34 skrll Exp $	 */
+/*	$NetBSD: rtld.c,v 1.170 2013/10/19 17:19:30 christos Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: rtld.c,v 1.169 2013/05/09 15:47:34 skrll Exp $);
+__RCSID($NetBSD: rtld.c,v 1.170 2013/10/19 17:19:30 christos Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -1290,6 +1290,7 @@ dladdr(const void *addr, Dl_info *info)
 		info-dli_saddr = symbol_addr;
 		best_def = def;
 
+
 		/* Exact match? */
 		if (info-dli_saddr == addr)
 			break;
@@ -1299,6 +1300,8 @@ dladdr(const void *addr, Dl_info *info)
 	if (best_def != NULL  ELF_ST_TYPE(best_def-st_info) == STT_FUNC)
 		info-dli_saddr = (void *)_rtld_function_descriptor_alloc(obj,
 		best_def, 0);
+#else
+	__USE(best_def);
 #endif /* __HAVE_FUNCTION_DESCRIPTORS */
 
 	lookup_mutex_exit();

Index: src/libexec/lfs_cleanerd/lfs_cleanerd.c
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.36 src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.37
--- src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.36	Tue Jun 18 14:18:57 2013
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.c	Sat Oct 19 13:19:30 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_cleanerd.c,v 1.36 2013/06/18 18:18:57 christos Exp $	 */
+/* $NetBSD: lfs_cleanerd.c,v 1.37 2013/10/19 17:19:30 christos Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -1353,7 +1353,9 @@ lfs_cleaner_main(int argc, char **argv)
 {
 	int i, opt, error, r, loopcount, nodetach;
 	struct timeval tv;
+#ifdef LFS_CLEANER_AS_LIB
 	sem_t *semaddr = NULL;
+#endif
 	CLEANERINFO ci;
 #ifndef USE_CLIENT_SERVER
 	char *cp, *pidname;
@@ -1414,13 +1416,11 @@ lfs_cleaner_main(int argc, char **argv)
 		case 's':	/* Small writes */
 			do_small = 1;
 			break;
+#ifdef LFS_CLEANER_AS_LIB
 		case 'S':	/* semaphore */
-#ifndef LFS_CLEANER_AS_LIB
-			usage();
-			/*NOTREACHED*/
-#endif
 			semaddr = (void*)(uintptr_t)strtoull(optarg,NULL,0);
 			break;
+#endif
 		case 't':	/* timeout */
 			segwait_timeout = atoi(optarg);
 			break;



CVS commit: src/games

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:23:09 UTC 2013

Modified Files:
src/games/backgammon/teachgammon: ttext2.c
src/games/boggle/boggle: prtable.c
src/games/gomoku: pickmove.c
src/games/hunt/huntd: driver.c
src/games/sail: sync.c
src/games/tetris: scores.c

Log Message:
fix unused variable warnings


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/games/backgammon/teachgammon/ttext2.c
cvs rdiff -u -r1.9 -r1.10 src/games/boggle/boggle/prtable.c
cvs rdiff -u -r1.21 -r1.22 src/games/gomoku/pickmove.c
cvs rdiff -u -r1.21 -r1.22 src/games/hunt/huntd/driver.c
cvs rdiff -u -r1.33 -r1.34 src/games/sail/sync.c
cvs rdiff -u -r1.20 -r1.21 src/games/tetris/scores.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/backgammon/teachgammon/ttext2.c
diff -u src/games/backgammon/teachgammon/ttext2.c:1.9 src/games/backgammon/teachgammon/ttext2.c:1.10
--- src/games/backgammon/teachgammon/ttext2.c:1.9	Mon Mar 22 01:10:19 2010
+++ src/games/backgammon/teachgammon/ttext2.c	Sat Oct 19 13:23:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttext2.c,v 1.9 2010/03/22 05:10:19 mrg Exp $	*/
+/*	$NetBSD: ttext2.c,v 1.10 2013/10/19 17:23:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)ttext2.c	8.1 (Berkeley) 5/31/93;
 #else
-__RCSID($NetBSD: ttext2.c,v 1.9 2010/03/22 05:10:19 mrg Exp $);
+__RCSID($NetBSD: ttext2.c,v 1.10 2013/10/19 17:23:08 christos Exp $);
 #endif
 #endif/* not lint */
 
@@ -129,14 +129,12 @@ const char   *const lastch[] = {
 int
 wrtext(const char *const *txt)
 {
-	const char  *const *begin;
 	const char   *a;
 	charb;
 	const char   *c;
 	int i;
 
 	fixtty(noech);
-	begin = txt;
 	while (*txt) {
 		a = *(txt++);
 		if (*a != '\0') {
@@ -187,7 +185,6 @@ wrtext(const char *const *txt)
 			fixtty(noech);
 			if (tflag)
 curmove(curr, 0);
-			begin = txt;
 		}
 	}
 	fixtty(raw);

Index: src/games/boggle/boggle/prtable.c
diff -u src/games/boggle/boggle/prtable.c:1.9 src/games/boggle/boggle/prtable.c:1.10
--- src/games/boggle/boggle/prtable.c:1.9	Fri Jul  1 12:38:24 2005
+++ src/games/boggle/boggle/prtable.c	Sat Oct 19 13:23:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: prtable.c,v 1.9 2005/07/01 16:38:24 jmc Exp $	*/
+/*	$NetBSD: prtable.c,v 1.10 2013/10/19 17:23:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -36,7 +36,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: prtable.c,v 1.9 2005/07/01 16:38:24 jmc Exp $);
+__RCSID($NetBSD: prtable.c,v 1.10 2013/10/19 17:23:08 christos Exp $);
 #endif /* not lint */
 
 #include curses.h
@@ -106,6 +106,7 @@ prtable(const char *const base[], int nu
 			}
 }
 		getyx(stdscr, row, col);
+		__USE(col);
 		move(row + 1, 0);
 }
 	refresh();

Index: src/games/gomoku/pickmove.c
diff -u src/games/gomoku/pickmove.c:1.21 src/games/gomoku/pickmove.c:1.22
--- src/games/gomoku/pickmove.c:1.21	Sat Oct 13 16:57:35 2012
+++ src/games/gomoku/pickmove.c	Sat Oct 19 13:23:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pickmove.c,v 1.21 2012/10/13 20:57:35 dholland Exp $	*/
+/*	$NetBSD: pickmove.c,v 1.22 2013/10/19 17:23:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)pickmove.c	8.2 (Berkeley) 5/3/95;
 #else
-__RCSID($NetBSD: pickmove.c,v 1.21 2012/10/13 20:57:35 dholland Exp $);
+__RCSID($NetBSD: pickmove.c,v 1.22 2013/10/19 17:23:08 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -1083,7 +1083,7 @@ checkframes(struct combostr *cbp, struct
 	int s, struct overlap_info *vertices)
 {
 	struct combostr *tcbp, *lcbp;
-	int i, n, mask, flags, verts, loop, myindex, fcnt;
+	int i, n, mask, flags, verts, myindex, fcnt;
 	union comboval cb;
 	u_char *str;
 	short *ip;
@@ -1094,7 +1094,6 @@ checkframes(struct combostr *cbp, struct
 	cb.s = s;
 	fcnt = cb.c.a - 2;
 	verts = 0;
-	loop = 0;
 	myindex = cbp-c_nframes;
 	n = (fcbp - frames) * FAREA;
 	str = overlap[n];

Index: src/games/hunt/huntd/driver.c
diff -u src/games/hunt/huntd/driver.c:1.21 src/games/hunt/huntd/driver.c:1.22
--- src/games/hunt/huntd/driver.c:1.21	Wed Aug 31 12:24:56 2011
+++ src/games/hunt/huntd/driver.c	Sat Oct 19 13:23:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: driver.c,v 1.21 2011/08/31 16:24:56 plunky Exp $	*/
+/*	$NetBSD: driver.c,v 1.22 2013/10/19 17:23:08 christos Exp $	*/
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: driver.c,v 1.21 2011/08/31 16:24:56 plunky Exp $);
+__RCSID($NetBSD: driver.c,v 1.22 2013/10/19 17:23:08 christos Exp $);
 #endif /* not lint */
 
 #include sys/ioctl.h
@@ -88,7 +88,7 @@ main(int ac, char **av, char **ep)
 	PLAYER *pp;
 #ifdef INTERNET
 	u_short msg;
-	short port_num, reply;
+	short reply;
 	socklen_t namelen;
 	SOCKET test;
 #endif
@@ 

CVS commit: src/tests/lib/libppath

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:28:38 UTC 2013

Modified Files:
src/tests/lib/libppath: Makefile

Log Message:
build the .h before the .o


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libppath/Makefile

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

Modified files:

Index: src/tests/lib/libppath/Makefile
diff -u src/tests/lib/libppath/Makefile:1.4 src/tests/lib/libppath/Makefile:1.5
--- src/tests/lib/libppath/Makefile:1.4	Sat Mar 17 08:42:31 2012
+++ src/tests/lib/libppath/Makefile	Sat Oct 19 13:28:38 2013
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.4 2012/03/17 12:42:31 nakayama Exp $
+# $Id: Makefile,v 1.5 2013/10/19 17:28:38 christos Exp $
 
 .include bsd.own.mk
 
@@ -18,6 +18,7 @@ CPPFLAGS+=-I$(.OBJDIR)
 .plist.c:
 	AWK=${TOOL_AWK:Q} ${HOST_SH} ${.CURDIR}/plist_to_c ${.TARGET:S,.c$,,}  ${.IMPSRC}  ${.TARGET}
 
+t_ppath.o: personnel.h
 CLEANFILES+=personnel.c personnel.h
 
 #LDADD+=-L$(LIBPPATH)



CVS commit: src/tests/include

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:44:37 UTC 2013

Modified Files:
src/tests/include: t_inttypes.c

Log Message:
initialize variables


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/include/t_inttypes.c

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

Modified files:

Index: src/tests/include/t_inttypes.c
diff -u src/tests/include/t_inttypes.c:1.2 src/tests/include/t_inttypes.c:1.3
--- src/tests/include/t_inttypes.c:1.2	Sun Jul 18 08:16:19 2010
+++ src/tests/include/t_inttypes.c	Sat Oct 19 13:44:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_inttypes.c,v 1.2 2010/07/18 12:16:19 jmmv Exp $	*/
+/*	$NetBSD: t_inttypes.c,v 1.3 2013/10/19 17:44:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,34 +37,34 @@ ATF_TC_BODY(int_fmtio, tc)
 {
 	char buf[64];
 
-	int8_t i8;
-	int16_t i16;
-	int32_t i32;
-	int64_t i64;
-	int_least8_t il8;
-	int_least16_t il16;
-	int_least32_t il32;
-	int_least64_t il64;
-	int_fast8_t if8;
-	int_fast16_t if16;
-	int_fast32_t if32;
-	int_fast64_t if64;
-	intmax_t im;
-	intptr_t ip;
-	uint8_t ui8;
-	uint16_t ui16;
-	uint32_t ui32;
-	uint64_t ui64;
-	uint_least8_t uil8;
-	uint_least16_t uil16;
-	uint_least32_t uil32;
-	uint_least64_t uil64;
-	uint_fast8_t uif8;
-	uint_fast16_t uif16;
-	uint_fast32_t uif32;
-	uint_fast64_t uif64;
-	uintmax_t uim;
-	uintptr_t uip;
+	int8_t i8 = 0;
+	int16_t i16 = 0;
+	int32_t i32 = 0;
+	int64_t i64 = 0;
+	int_least8_t il8 = 0;
+	int_least16_t il16 = 0;
+	int_least32_t il32 = 0;
+	int_least64_t il64 = 0;
+	int_fast8_t if8 = 0;
+	int_fast16_t if16 = 0;
+	int_fast32_t if32 = 0;
+	int_fast64_t if64 = 0;
+	intmax_t im = 0;
+	intptr_t ip = 0;
+	uint8_t ui8 = 0;
+	uint16_t ui16 = 0;
+	uint32_t ui32 = 0;
+	uint64_t ui64 = 0;
+	uint_least8_t uil8 = 0;
+	uint_least16_t uil16 = 0;
+	uint_least32_t uil32 = 0;
+	uint_least64_t uil64 = 0;
+	uint_fast8_t uif8 = 0;
+	uint_fast16_t uif16 = 0;
+	uint_fast32_t uif32 = 0;
+	uint_fast64_t uif64 = 0;
+	uintmax_t uim = 0;
+	uintptr_t uip = 0;
 
 #define	PRINT(fmt, var) \
 	snprintf(buf, sizeof(buf), % fmt, var)



CVS commit: src/tests

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 17:45:01 UTC 2013

Modified Files:
src/tests/fs/nfs/nfsservice: mountd.c nfsd.c
src/tests/fs/nfs/nfsservice/rpcbind: pmap_svc.c rpcbind.c
src/tests/fs/puffs: t_basic.c
src/tests/fs/puffs/h_dtfs: dtfs_subr.c dtfs_vnops.c
src/tests/fs/vfs: t_vnops.c
src/tests/include/sys: t_socket.c
src/tests/kernel: t_lockf.c
src/tests/lib/libc/gen: t_dir.c
src/tests/lib/libc/stdio: t_fmemopen.c
src/tests/lib/libpthread: t_cond.c t_sigmask.c
src/tests/net/net: t_pktinfo.c

Log Message:
fix unused variable warnings


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/nfs/nfsservice/mountd.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/nfs/nfsservice/nfsd.c
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c
cvs rdiff -u -r1.11 -r1.12 src/tests/fs/puffs/t_basic.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/puffs/h_dtfs/dtfs_subr.c
cvs rdiff -u -r1.9 -r1.10 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
cvs rdiff -u -r1.37 -r1.38 src/tests/fs/vfs/t_vnops.c
cvs rdiff -u -r1.2 -r1.3 src/tests/include/sys/t_socket.c
cvs rdiff -u -r1.8 -r1.9 src/tests/kernel/t_lockf.c
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/gen/t_dir.c
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdio/t_fmemopen.c
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libpthread/t_cond.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libpthread/t_sigmask.c
cvs rdiff -u -r1.1 -r1.2 src/tests/net/net/t_pktinfo.c

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

Modified files:

Index: src/tests/fs/nfs/nfsservice/mountd.c
diff -u src/tests/fs/nfs/nfsservice/mountd.c:1.7 src/tests/fs/nfs/nfsservice/mountd.c:1.8
--- src/tests/fs/nfs/nfsservice/mountd.c:1.7	Sun Jan 22 13:36:17 2012
+++ src/tests/fs/nfs/nfsservice/mountd.c	Sat Oct 19 13:45:00 2013
@@ -1,4 +1,4 @@
-/* 	$NetBSD: mountd.c,v 1.7 2012/01/22 18:36:17 christos Exp $	 */
+/* 	$NetBSD: mountd.c,v 1.8 2013/10/19 17:45:00 christos Exp $	 */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)mountd.c  8.15 (Berkeley) 5/1/95;
 #else
-__RCSID($NetBSD: mountd.c,v 1.7 2012/01/22 18:36:17 christos Exp $);
+__RCSID($NetBSD: mountd.c,v 1.8 2013/10/19 17:45:00 christos Exp $);
 #endif
 #endif/* not lint */
 
@@ -497,7 +497,6 @@ mntsrv(rqstp, transp)
 	struct fhreturn fhr;
 	struct stat stb;
 	struct statvfs   fsb;
-	struct addrinfo *ai;
 	char host[NI_MAXHOST], numerichost[NI_MAXHOST];
 	int lookup_failed = 1;
 	struct sockaddr *saddr;
@@ -532,7 +531,6 @@ mntsrv(rqstp, transp)
 	if (getnameinfo(saddr, saddr-sa_len, numerichost,
 	sizeof numerichost, NULL, 0, ninumeric) != 0)
 		strlcpy(numerichost, ?, sizeof(numerichost));
-	ai = NULL;
 	ret = 0;
 	switch (rqstp-rq_proc) {
 	case NULLPROC:

Index: src/tests/fs/nfs/nfsservice/nfsd.c
diff -u src/tests/fs/nfs/nfsservice/nfsd.c:1.3 src/tests/fs/nfs/nfsservice/nfsd.c:1.4
--- src/tests/fs/nfs/nfsservice/nfsd.c:1.3	Wed Jul 28 11:12:17 2010
+++ src/tests/fs/nfs/nfsservice/nfsd.c	Sat Oct 19 13:45:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfsd.c,v 1.3 2010/07/28 15:12:17 pooka Exp $	*/
+/*	$NetBSD: nfsd.c,v 1.4 2013/10/19 17:45:00 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)nfsd.c	8.9 (Berkeley) 3/29/95;
 #else
-__RCSID($NetBSD: nfsd.c,v 1.3 2010/07/28 15:12:17 pooka Exp $);
+__RCSID($NetBSD: nfsd.c,v 1.4 2013/10/19 17:45:00 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -149,18 +149,17 @@ nfsd_main(argc, argv)
 	struct sockaddr_in inetpeer;
 	struct pollfd set[4];
 	socklen_t len;
-	int ch, cltpflag, connect_type_cnt, i, maxsock, msgsock;
+	int ch, connect_type_cnt, i, msgsock;
 	int nfsdcnt, on = 1, reregister, sock, tcpflag, tcpsock;
 	int tcp6sock, ip6flag;
-	int tp4cnt, tp4flag, tpipcnt, tpipflag, udpflag, ecode, s;
+	int tp4cnt, tp4flag, tpipcnt, udpflag, ecode, s;
 	int error = 0;
 
 #define	DEFNFSDCNT	 4
 	nfsdcnt = DEFNFSDCNT;
-	cltpflag = reregister = tcpflag = tp4cnt = tp4flag = tpipcnt = 0;
-	tpipflag = udpflag = ip6flag = 0;
+	reregister = tcpflag = tp4cnt = tp4flag = tpipcnt = 0;
+	udpflag = ip6flag = 0;
 	nconf_udp = nconf_tcp = nconf_udp6 = nconf_tcp6 = NULL;
-	maxsock = 0;
 	tcpsock = tcp6sock = -1;
 #define	GETOPT	6n:rtu
 #define	USAGE	[-rtu] [-n num_servers]

Index: src/tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c
diff -u src/tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c:1.1 src/tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c:1.2
--- src/tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c:1.1	Mon Jul 26 11:53:00 2010
+++ src/tests/fs/nfs/nfsservice/rpcbind/pmap_svc.c	Sat Oct 19 13:45:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_svc.c,v 1.1 2010/07/26 15:53:00 pooka Exp $	*/
+/*	$NetBSD: 

CVS commit: src/sys/net

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 18:39:31 UTC 2013

Modified Files:
src/sys/net: if.c

Log Message:
Ifdef a variable like its use


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/sys/net/if.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/net/if.c
diff -u src/sys/net/if.c:1.267 src/sys/net/if.c:1.268
--- src/sys/net/if.c:1.267	Sun Oct  6 01:21:24 2013
+++ src/sys/net/if.c	Sat Oct 19 18:39:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.267 2013/10/06 01:21:24 christos Exp $	*/
+/*	$NetBSD: if.c,v 1.268 2013/10/19 18:39:30 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if.c,v 1.267 2013/10/06 01:21:24 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if.c,v 1.268 2013/10/19 18:39:30 martin Exp $);
 
 #include opt_inet.h
 
@@ -1323,7 +1323,10 @@ link_rtrequest(int cmd, struct rtentry *
 void
 if_link_state_change(struct ifnet *ifp, int link_state)
 {
-	int old_link_state, s;
+	int s;
+#ifdef DEBUG
+	int old_link_state;
+#endif
 
 	s = splnet();
 	if (ifp-if_link_state == link_state) {
@@ -1331,7 +1334,9 @@ if_link_state_change(struct ifnet *ifp, 
 		return;
 	}
 
+#ifdef DEBUG
 	old_link_state = ifp-if_link_state;
+#endif
 	ifp-if_link_state = link_state;
 #ifdef DEBUG
 	log(LOG_DEBUG, %s: link state %s (was %s)\n, ifp-if_xname,



CVS commit: src/sys/kern

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 18:42:05 UTC 2013

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

Log Message:
cpu_need_resched(ci, type) might not make use of the type argument - mark
the variable declaration accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/kern/kern_runq.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_runq.c
diff -u src/sys/kern/kern_runq.c:1.38 src/sys/kern/kern_runq.c:1.39
--- src/sys/kern/kern_runq.c:1.38	Tue Mar 12 23:16:31 2013
+++ src/sys/kern/kern_runq.c	Sat Oct 19 18:42:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.38 2013/03/12 23:16:31 yamt Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.39 2013/10/19 18:42:05 martin Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius rmind at NetBSD org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_runq.c,v 1.38 2013/03/12 23:16:31 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_runq.c,v 1.39 2013/10/19 18:42:05 martin Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -211,7 +211,7 @@ sched_enqueue(struct lwp *l, bool swtch)
 	TAILQ_HEAD(, lwp) *q_head;
 	const pri_t eprio = lwp_eprio(l);
 	struct cpu_info *ci;
-	int type;
+	int type __unused;
 
 	ci = l-l_cpu;
 	spc = ci-ci_schedstate;



CVS commit: src/sys/arch/m68k/m68k

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:03:30 UTC 2013

Modified Files:
src/sys/arch/m68k/m68k: bus_dma.c

Log Message:
Mark a variable that is only tested in DIAGNOSTIC kernels as potentially
unused.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/m68k/m68k/bus_dma.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/m68k/m68k/bus_dma.c
diff -u src/sys/arch/m68k/m68k/bus_dma.c:1.33 src/sys/arch/m68k/m68k/bus_dma.c:1.34
--- src/sys/arch/m68k/m68k/bus_dma.c:1.33	Wed Jul 11 17:13:30 2012
+++ src/sys/arch/m68k/m68k/bus_dma.c	Sat Oct 19 19:03:30 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.33 2012/07/11 17:13:30 rkujawa Exp $ */
+/* $NetBSD: bus_dma.c,v 1.34 2013/10/19 19:03:30 martin Exp $ */
 
 /*
  * This file was taken from from alpha/common/bus_dma.c
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.33 2012/07/11 17:13:30 rkujawa Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.34 2013/10/19 19:03:30 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -138,7 +138,7 @@ _bus_dmamap_load_buffer_direct_common(bu
 	vaddr_t vaddr = (vaddr_t)buf;
 	int seg, cacheable, coherent;
 	pmap_t pmap;
-	bool rv;
+	bool rv __unused;
 
 	coherent = BUS_DMA_COHERENT;
 	lastaddr = *lastaddrp;



CVS commit: src/sys/arch/mac68k/mac68k

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:08:39 UTC 2013

Modified Files:
src/sys/arch/mac68k/mac68k: bus_space.c

Log Message:
Avoid unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mac68k/mac68k/bus_space.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/mac68k/mac68k/bus_space.c
diff -u src/sys/arch/mac68k/mac68k/bus_space.c:1.31 src/sys/arch/mac68k/mac68k/bus_space.c:1.32
--- src/sys/arch/mac68k/mac68k/bus_space.c:1.31	Mon Apr 28 20:23:27 2008
+++ src/sys/arch/mac68k/mac68k/bus_space.c	Sat Oct 19 19:08:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.31 2008/04/28 20:23:27 martin Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.32 2013/10/19 19:08:39 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.31 2008/04/28 20:23:27 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.32 2013/10/19 19:08:39 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -139,7 +139,9 @@ int
 bus_space_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags,
 	  bus_space_handle_t *hp)
 {
+#ifdef DIAGNOSTIC
 	paddr_t pa, endpa;
+#endif
 	int error;
 
 	/*
@@ -151,10 +153,10 @@ bus_space_map(bus_space_tag_t t, bus_add
 	if (error)
 		return (error);
 
+#ifdef DIAGNOSTIC
 	pa = m68k_trunc_page(bpa + t);
 	endpa = m68k_round_page((bpa + t + size) - 1);
 
-#ifdef DIAGNOSTIC
 	if (endpa = pa)
 		panic(bus_space_map: overflow);
 #endif
@@ -269,7 +271,6 @@ int
 mac68k_bus_space_probe(bus_space_tag_t t, bus_space_handle_t h,
 		   bus_size_t offset, int size)
 {
-	int i;
 	label_t faultbuf;
 
 	nofault = faultbuf;
@@ -280,13 +281,13 @@ mac68k_bus_space_probe(bus_space_tag_t t
 
 	switch (size) {
 	case 1:
-		i = bus_space_read_1(t, h, offset);
+		bus_space_read_1(t, h, offset);
 		break;
 	case 2:
-		i = bus_space_read_2(t, h, offset);
+		bus_space_read_2(t, h, offset);
 		break;
 	case 4:
-		i = bus_space_read_4(t, h, offset);
+		bus_space_read_4(t, h, offset);
 		break;
 	case 8:
 	default:



CVS commit: src/sys/dev/scsipi

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:10:12 UTC 2013

Modified Files:
src/sys/dev/scsipi: cd.c

Log Message:
Mark a potentially unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.314 -r1.315 src/sys/dev/scsipi/cd.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/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.314 src/sys/dev/scsipi/cd.c:1.315
--- src/sys/dev/scsipi/cd.c:1.314	Sat Sep 28 09:00:26 2013
+++ src/sys/dev/scsipi/cd.c	Sat Oct 19 19:10:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.314 2013/09/28 09:00:26 skrll Exp $	*/
+/*	$NetBSD: cd.c,v 1.315 2013/10/19 19:10:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cd.c,v 1.314 2013/09/28 09:00:26 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: cd.c,v 1.315 2013/10/19 19:10:12 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -748,7 +748,7 @@ cdstart(struct scsipi_periph *periph)
 	struct scsi_rw_6 cmd_small;
 	struct scsipi_generic *cmdp;
 	struct scsipi_xfer *xs;
-	int flags, nblks, cmdlen, error;
+	int flags, nblks, cmdlen, error __unused;
 
 	SC_DEBUG(periph, SCSIPI_DB2, (cdstart ));
 	/*



CVS commit: src/sys/arch/m68k/m68k

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:13:51 UTC 2013

Modified Files:
src/sys/arch/m68k/m68k: db_disasm.c

Log Message:
Remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/m68k/m68k/db_disasm.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/m68k/m68k/db_disasm.c
diff -u src/sys/arch/m68k/m68k/db_disasm.c:1.39 src/sys/arch/m68k/m68k/db_disasm.c:1.40
--- src/sys/arch/m68k/m68k/db_disasm.c:1.39	Tue Jan 31 21:17:57 2012
+++ src/sys/arch/m68k/m68k/db_disasm.c	Sat Oct 19 19:13:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_disasm.c,v 1.39 2012/01/31 21:17:57 mlelstv Exp $	*/
+/*	$NetBSD: db_disasm.c,v 1.40 2013/10/19 19:13:51 martin Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.39 2012/01/31 21:17:57 mlelstv Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.40 2013/10/19 19:13:51 martin Exp $);
 
 #include sys/param.h
 #ifdef _KERNEL
@@ -849,7 +849,7 @@ opcode_0101(dis_buffer_t *dbuf, u_short 
 static void
 opcode_branch(dis_buffer_t *dbuf, u_short opc)
 {
-	int disp, sz;
+	int disp;
 
 	if (IS_INST(BRA,opc))
 		addstr(dbuf, bra);
@@ -863,20 +863,17 @@ opcode_branch(dis_buffer_t *dbuf, u_shor
 		/* 16-bit signed displacement */
 		disp = *(dbuf-val + 1);
 		dbuf-used++;
-		sz = SIZE_WORD;
 		addchar('w');
 	} else if (disp == 0xff) {
 		/* 32-bit signed displacement */
 		disp = *(long *)(dbuf-val + 1);
 		dbuf-used += 2;
-		sz = SIZE_LONG;
 		addchar('l');
 	} else {
 		/* 8-bit signed displacement in opcode. */
 		/* Needs to be sign-extended... */
 		if (ISBITSET(disp,7))
 			disp -= 256;
-		sz = SIZE_BYTE;
 		addchar('b');
 	}
 	addchar('\t');



CVS commit: src/sys/ufs/ffs

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:20:50 UTC 2013

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

Log Message:
Eliminate a variable only used in diagnostic kernels


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/sys/ufs/ffs/ffs_alloc.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_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.140 src/sys/ufs/ffs/ffs_alloc.c:1.141
--- src/sys/ufs/ffs/ffs_alloc.c:1.140	Mon Sep 30 18:58:00 2013
+++ src/sys/ufs/ffs/ffs_alloc.c	Sat Oct 19 19:20:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.140 2013/09/30 18:58:00 hannken Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.141 2013/10/19 19:20:50 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_alloc.c,v 1.140 2013/09/30 18:58:00 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_alloc.c,v 1.141 2013/10/19 19:20:50 martin Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -1202,7 +1202,6 @@ ffs_alloccg(struct inode *ip, int cg, da
 static daddr_t
 ffs_alloccgblk(struct inode *ip, struct buf *bp, daddr_t bpref, int flags)
 {
-	struct ufsmount *ump;
 	struct fs *fs = ip-i_fs;
 	struct cg *cgp;
 	int cg;
@@ -1213,9 +1212,7 @@ ffs_alloccgblk(struct inode *ip, struct 
 	const int needswap = UFS_FSNEEDSWAP(fs);
 #endif
 
-	ump = ip-i_ump;
-
-	KASSERT(mutex_owned(ump-um_lock));
+	KASSERT(mutex_owned(ip-i_ump-um_lock));
 
 	cgp = (struct cg *)bp-b_data;
 	blksfree = cg_blksfree(cgp, needswap);



CVS commit: src/sys/arch

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 19:21:00 UTC 2013

Modified Files:
src/sys/arch/amiga/include: cpu.h
src/sys/arch/atari/include: cpu.h
src/sys/arch/cesfic/include: cpu.h
src/sys/arch/hp300/include: cpu.h
src/sys/arch/ia64/include: cpu.h
src/sys/arch/luna68k/include: cpu.h
src/sys/arch/mac68k/include: cpu.h
src/sys/arch/mvme68k/include: cpu.h
src/sys/arch/news68k/include: cpu.h
src/sys/arch/next68k/include: cpu.h
src/sys/arch/sh3/include: cpu.h
src/sys/arch/sparc/include: cpu.h
src/sys/arch/sun68k/include: cpu.h
src/sys/arch/vax/include: cpu.h
src/sys/arch/x68k/include: cpu.h

Log Message:
make cpu_need_resched() macros consistent; __USE flags


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/amiga/include/cpu.h
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/atari/include/cpu.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/cesfic/include/cpu.h
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/hp300/include/cpu.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/include/cpu.h
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/luna68k/include/cpu.h
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/mac68k/include/cpu.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/next68k/include/cpu.h
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/sh3/include/cpu.h
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/sun68k/include/cpu.h
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/vax/include/cpu.h
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/x68k/include/cpu.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/amiga/include/cpu.h
diff -u src/sys/arch/amiga/include/cpu.h:1.79 src/sys/arch/amiga/include/cpu.h:1.80
--- src/sys/arch/amiga/include/cpu.h:1.79	Mon May 16 09:22:52 2011
+++ src/sys/arch/amiga/include/cpu.h	Sat Oct 19 15:20:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.79 2011/05/16 13:22:52 tsutsui Exp $	*/
+/*	$NetBSD: cpu.h,v 1.80 2013/10/19 19:20:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -77,7 +77,11 @@ struct clockframe {
  * Preempt the current process if in interrupt from user mode,
  * or after the current trap/syscall if in system mode.
  */
-#define	cpu_need_resched(ci,flags)	{ci-ci_want_resched = 1; setsoftast();}
+#define	cpu_need_resched(ci,flags)	do {	\
+	__USE(flags); \
+	ci-ci_want_resched = 1;		\
+	setsoftast();\
+} while (/*CONSTCOND*/0)
 
 /*
  * Give a profiling tick to the current process from the softclock

Index: src/sys/arch/atari/include/cpu.h
diff -u src/sys/arch/atari/include/cpu.h:1.69 src/sys/arch/atari/include/cpu.h:1.70
--- src/sys/arch/atari/include/cpu.h:1.69	Thu Feb  2 11:59:42 2012
+++ src/sys/arch/atari/include/cpu.h	Sat Oct 19 15:20:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.69 2012/02/02 16:59:42 tsutsui Exp $	*/
+/*	$NetBSD: cpu.h,v 1.70 2013/10/19 19:20:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -85,7 +85,11 @@ struct clockframe {
  * Preempt the current process if in interrupt from user mode,
  * or after the current trap/syscall if in system mode.
  */
-#define	cpu_need_resched(ci,flags)	{ci-ci_want_resched = 1; setsoftast();}
+#define	cpu_need_resched(ci,flags)	do {	\
+	__USE(flags); \
+	ci-ci_want_resched = 1;		\
+	setsoftast();\
+} while (/*CONSTCOND*/0)
 
 /*
  * Give a profiling tick to the current process from the softclock

Index: src/sys/arch/cesfic/include/cpu.h
diff -u src/sys/arch/cesfic/include/cpu.h:1.28 src/sys/arch/cesfic/include/cpu.h:1.29
--- src/sys/arch/cesfic/include/cpu.h:1.28	Thu Feb  2 11:59:42 2012
+++ src/sys/arch/cesfic/include/cpu.h	Sat Oct 19 15:20:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.28 2012/02/02 16:59:42 tsutsui Exp $	*/
+/*	$NetBSD: cpu.h,v 1.29 2013/10/19 19:20:59 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -79,8 +79,11 @@ struct clockframe {
  * Preempt the current process if in interrupt from user mode,
  * or after the current trap/syscall if in system mode.
  */
-#define	cpu_need_resched(ci, flags)	\
-	do { ci-ci_want_resched = 1; aston(); } while (/* CONSTCOND */0)
+#define	cpu_need_resched(ci,flags)	do {	\
+	__USE(flags); \
+	ci-ci_want_resched = 1;		\
+	aston();\
+} while (/*CONSTCOND*/0)
 
 /*
  * Give a profiling tick to the current process when the user profiling

Index: src/sys/arch/hp300/include/cpu.h
diff -u src/sys/arch/hp300/include/cpu.h:1.67 src/sys/arch/hp300/include/cpu.h:1.68
--- src/sys/arch/hp300/include/cpu.h:1.67	Thu Feb  2 11:59:42 2012
+++ src/sys/arch/hp300/include/cpu.h	Sat Oct 19 15:20:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.67 2012/02/02 16:59:42 tsutsui Exp $	*/
+/*	$NetBSD: cpu.h,v 1.68 2013/10/19 

CVS commit: src/sys/kern

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 19:22:16 UTC 2013

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

Log Message:
remove __unused now that it is used.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/kern/kern_runq.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_runq.c
diff -u src/sys/kern/kern_runq.c:1.39 src/sys/kern/kern_runq.c:1.40
--- src/sys/kern/kern_runq.c:1.39	Sat Oct 19 14:42:05 2013
+++ src/sys/kern/kern_runq.c	Sat Oct 19 15:22:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.39 2013/10/19 18:42:05 martin Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.40 2013/10/19 19:22:16 christos Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius rmind at NetBSD org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_runq.c,v 1.39 2013/10/19 18:42:05 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_runq.c,v 1.40 2013/10/19 19:22:16 christos Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -211,7 +211,7 @@ sched_enqueue(struct lwp *l, bool swtch)
 	TAILQ_HEAD(, lwp) *q_head;
 	const pri_t eprio = lwp_eprio(l);
 	struct cpu_info *ci;
-	int type __unused;
+	int type;
 
 	ci = l-l_cpu;
 	spc = ci-ci_schedstate;



CVS commit: src/sys/ufs/ffs

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:29:59 UTC 2013

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

Log Message:
Mark a potentially unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/ufs/ffs/ffs_wapbl.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_wapbl.c
diff -u src/sys/ufs/ffs/ffs_wapbl.c:1.22 src/sys/ufs/ffs/ffs_wapbl.c:1.23
--- src/sys/ufs/ffs/ffs_wapbl.c:1.22	Sun Jun 23 22:03:34 2013
+++ src/sys/ufs/ffs/ffs_wapbl.c	Sat Oct 19 19:29:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_wapbl.c,v 1.22 2013/06/23 22:03:34 dholland Exp $	*/
+/*	$NetBSD: ffs_wapbl.c,v 1.23 2013/10/19 19:29:59 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_wapbl.c,v 1.22 2013/06/23 22:03:34 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_wapbl.c,v 1.23 2013/10/19 19:29:59 martin Exp $);
 
 #define WAPBL_INTERNAL
 
@@ -165,7 +165,7 @@ ffs_wapbl_sync_metadata(struct mount *mp
 {
 	struct ufsmount *ump = VFSTOUFS(mp);
 	struct fs *fs = ump-um_fs;
-	int i, error;
+	int i, error __unused;
 
 #ifdef WAPBL_DEBUG_INODES
 	ufs_wapbl_verify_inodes(mp, ffs_wapbl_sync_metadata);



CVS commit: src/sys/ufs/ffs

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:28:13 UTC 2013

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

Log Message:
Mark unused (in the !FFS_EI case) variables as such.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 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.130 src/sys/ufs/ffs/ffs_snapshot.c:1.131
--- src/sys/ufs/ffs/ffs_snapshot.c:1.130	Sat Oct 19 16:30:57 2013
+++ src/sys/ufs/ffs/ffs_snapshot.c	Sat Oct 19 19:28:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_snapshot.c,v 1.130 2013/10/19 16:30:57 martin Exp $	*/
+/*	$NetBSD: ffs_snapshot.c,v 1.131 2013/10/19 19:28:13 martin Exp $	*/
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.130 2013/10/19 16:30:57 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.131 2013/10/19 19:28:13 martin Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -958,7 +958,7 @@ cgaccount1(int cg, struct vnode *vp, voi
 	struct fs *fs;
 	struct lwp *l = curlwp;
 	daddr_t base, numblks;
-	int error, len, loc, ns, indiroff;
+	int error, len, loc, ns __unused, indiroff;
 
 	ip = VTOI(vp);
 	fs = ip-i_fs;
@@ -1035,7 +1035,7 @@ static int
 expunge(struct vnode *snapvp, struct inode *cancelip, struct fs *fs,
 acctfunc_t acctfunc, int expungetype)
 {
-	int i, error, ns;
+	int i, error, ns __unused;
 	daddr_t lbn, rlbn;
 	daddr_t len, blkno, numblks, blksperindir;
 	struct ufs1_dinode *dip1;



CVS commit: src/sys/miscfs/genfs

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:36:16 UTC 2013

Modified Files:
src/sys/miscfs/genfs: genfs_io.c

Log Message:
Mark a potentially unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.56 src/sys/miscfs/genfs/genfs_io.c:1.57
--- src/sys/miscfs/genfs/genfs_io.c:1.56	Sat Oct 19 16:33:11 2013
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Oct 19 19:36:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.56 2013/10/19 16:33:11 martin Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.57 2013/10/19 19:36:16 martin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.56 2013/10/19 16:33:11 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.57 2013/10/19 19:36:16 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1733,7 +1733,7 @@ genfs_do_directio(struct vmspace *vs, va
 	vaddr_t kva, puva;
 	paddr_t pa;
 	vm_prot_t prot;
-	int error, rv, poff, koff;
+	int error, rv __unused, poff, koff;
 	const int pgoflags = PGO_CLEANIT | PGO_SYNCIO | PGO_JOURNALLOCKED |
 		(rw == UIO_WRITE ? PGO_FREE : 0);
 



CVS commit: src/sys/arch/sparc

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 19:40:23 UTC 2013

Modified Files:
src/sys/arch/sparc/dev: if_ie_obio.c kd.c tctrl.c ts102.c
src/sys/arch/sparc/include: pmap.h
src/sys/arch/sparc/sparc: cpuvar.h memecc.c timer.c

Log Message:
- remove unused but set variables.
- use __USE() where necessary.
- remove useless 'volatile' markers

kd.c:consinit() might be wrong for old proms, but i've not
changed it really.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/sparc/dev/if_ie_obio.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sparc/dev/kd.c
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/sparc/dev/tctrl.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sparc/dev/ts102.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/sparc/include/pmap.h
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sparc/sparc/memecc.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sparc/sparc/timer.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/sparc/dev/if_ie_obio.c
diff -u src/sys/arch/sparc/dev/if_ie_obio.c:1.40 src/sys/arch/sparc/dev/if_ie_obio.c:1.41
--- src/sys/arch/sparc/dev/if_ie_obio.c:1.40	Fri Jul  1 18:50:41 2011
+++ src/sys/arch/sparc/dev/if_ie_obio.c	Sat Oct 19 19:40:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ie_obio.c,v 1.40 2011/07/01 18:50:41 dyoung Exp $	*/
+/*	$NetBSD: if_ie_obio.c,v 1.41 2013/10/19 19:40:23 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ie_obio.c,v 1.40 2011/07/01 18:50:41 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ie_obio.c,v 1.41 2013/10/19 19:40:23 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -254,7 +254,6 @@ ie_obio_attach(device_t parent, device_t
 	int rseg;
 	int error;
 	paddr_t pa;
-	struct intrhand *ih;
 	bus_size_t memsize;
 	u_long iebase;
 	uint8_t myaddr[ETHER_ADDR_LEN];
@@ -392,7 +391,7 @@ ie_obio_attach(device_t parent, device_t
 	i82586_attach(sc, onboard, myaddr, media, NMEDIA, media[0]);
 
 	/* Establish interrupt channel */
-	ih = bus_intr_establish(oba-oba_bustag,
-oba-oba_pri, IPL_NET,
-i82586_intr, sc);
+	(void)bus_intr_establish(oba-oba_bustag,
+ oba-oba_pri, IPL_NET,
+ i82586_intr, sc);
 }

Index: src/sys/arch/sparc/dev/kd.c
diff -u src/sys/arch/sparc/dev/kd.c:1.51 src/sys/arch/sparc/dev/kd.c:1.52
--- src/sys/arch/sparc/dev/kd.c:1.51	Sat Oct 27 17:18:11 2012
+++ src/sys/arch/sparc/dev/kd.c	Sat Oct 19 19:40:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kd.c,v 1.51 2012/10/27 17:18:11 chs Exp $	*/
+/*	$NetBSD: kd.c,v 1.52 2013/10/19 19:40:23 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kd.c,v 1.51 2012/10/27 17:18:11 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: kd.c,v 1.52 2013/10/19 19:40:23 mrg Exp $);
 
 #include opt_kgdb.h
 #include fb.h
@@ -334,7 +334,6 @@ kdparam(struct tty *tp, struct termios *
 static void
 kdstart(struct tty *tp)
 {
-	struct clist *cl;
 	int s1, s2;
 
 	s1 = splsoftclock();
@@ -342,7 +341,6 @@ kdstart(struct tty *tp)
 	if (tp-t_state  (TS_BUSY|TS_TTSTOP|TS_TIMEOUT))
 		goto out;
 
-	cl = tp-t_outq;
 	if (ttypull(tp)) {
 		tp-t_state |= TS_BUSY;
 		if ((s1  PSR_PIL) == 0) {
@@ -619,15 +617,20 @@ prom_get_device_args(const char *prop, c
 void
 consinit(void)
 {
+#if 0
 	int inSource, outSink;
+#endif
 
 	switch (prom_version()) {
+#if 0
 	case PROM_OLDMON:
 	case PROM_OBP_V0:
 		/* The stdio handles identify the device type */
 		inSource = prom_stdin();
 		outSink  = prom_stdout();
 		break;
+	// XXXMRG  should these just set prom_stdin_node / prom_stdout_node?
+#endif
 
 	case PROM_OBP_V2:
 	case PROM_OBP_V3:

Index: src/sys/arch/sparc/dev/tctrl.c
diff -u src/sys/arch/sparc/dev/tctrl.c:1.56 src/sys/arch/sparc/dev/tctrl.c:1.57
--- src/sys/arch/sparc/dev/tctrl.c:1.56	Sat Oct 27 17:18:11 2012
+++ src/sys/arch/sparc/dev/tctrl.c	Sat Oct 19 19:40:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tctrl.c,v 1.56 2012/10/27 17:18:11 chs Exp $	*/
+/*	$NetBSD: tctrl.c,v 1.57 2013/10/19 19:40:23 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tctrl.c,v 1.56 2012/10/27 17:18:11 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: tctrl.c,v 1.57 2013/10/19 19:40:23 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -747,7 +747,7 @@ static void
 tctrl_read_event_status(struct tctrl_softc *sc)
 {
 	struct tctrl_req req;
-	int s, lid;
+	int s;
 	uint32_t v;
 
 	req.cmdbuf[0] = TS102_OP_RD_EVENT_STATUS;
@@ -800,7 +800,6 @@ tctrl_read_event_status(struct tctrl_sof
 		(sc-sc_ext_status  TS102_EXT_STATUS_LID_DOWN)
 		? closed : opened);
 #endif
-		lid = (sc-sc_ext_status  TS102_EXT_STATUS_LID_DOWN) == 0;
 	}
 	if (v  

CVS commit: src/sys/arch/mac68k/dev

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:47:55 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: if_mc.c

Log Message:
Remove an unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/mac68k/dev/if_mc.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/mac68k/dev/if_mc.c
diff -u src/sys/arch/mac68k/dev/if_mc.c:1.39 src/sys/arch/mac68k/dev/if_mc.c:1.40
--- src/sys/arch/mac68k/dev/if_mc.c:1.39	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/if_mc.c	Sat Oct 19 19:47:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mc.c,v 1.39 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: if_mc.c,v 1.40 2013/10/19 19:47:55 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang k...@azeotrope.org
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mc.c,v 1.39 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_mc.c,v 1.40 2013/10/19 19:47:55 martin Exp $);
 
 #include opt_ddb.h
 #include opt_inet.h
@@ -471,9 +471,9 @@ struct mc_softc *sc = arg;
 integrate void
 mc_tint(struct mc_softc *sc)
 {
-	u_int8_t xmtrc, xmtfs;
+	u_int8_t /* xmtrc,*/ xmtfs;
 
-	xmtrc = NIC_GET(sc, MACE_XMTRC);
+	/* xmtrc = */ NIC_GET(sc, MACE_XMTRC);
 	xmtfs = NIC_GET(sc, MACE_XMTFS);
 
 	if ((xmtfs  XMTSV) == 0)



CVS commit: src/lib/libc/net

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 19:56:56 UTC 2013

Modified Files:
src/lib/libc/net: Makefile.inc
Added Files:
src/lib/libc/net: inet6_getscopeid.3

Log Message:
document the scopeid functions


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/lib/libc/net/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/net/inet6_getscopeid.3

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

Modified files:

Index: src/lib/libc/net/Makefile.inc
diff -u src/lib/libc/net/Makefile.inc:1.84 src/lib/libc/net/Makefile.inc:1.85
--- src/lib/libc/net/Makefile.inc:1.84	Fri Oct 18 20:08:34 2013
+++ src/lib/libc/net/Makefile.inc	Sat Oct 19 15:56:56 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.84 2013/10/19 00:08:34 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.85 2013/10/19 19:56:56 christos Exp $
 #	@(#)Makefile.inc	8.2 (Berkeley) 9/5/93
 
 # net sources
@@ -120,12 +120,13 @@ MLINKS+=resolver.3 dn_comp.3 \
 # IPv6
 MAN+=	gai_strerror.3 getaddrinfo.3 getnameinfo.3 if_indextoname.3 \
 	inet6_option_space.3 inet6_rthdr_space.3 \
-	inet6_opt_init.3 inet6_rth_space.3
+	inet6_opt_init.3 inet6_rth_space.3 inet6_getscopeid.3
 MLINKS+=getaddrinfo.3 freeaddrinfo.3 \
 	getaddrinfo.3 allocaddrinfo.3 \
 	getifaddrs.3 freeifaddrs.3 \
 	if_indextoname.3 if_nametoindex.3 if_indextoname.3 if_nameindex.3 \
 	if_indextoname.3 if_freenameindex.3 \
+	inet6_getscopeid.3 inet6_putscopeid.3 \
 	inet6_option_space.3 inet6_option_init.3 \
 	inet6_option_space.3 inet6_option_append.3 \
 	inet6_option_space.3 inet6_option_alloc.3 \

Added files:

Index: src/lib/libc/net/inet6_getscopeid.3
diff -u /dev/null src/lib/libc/net/inet6_getscopeid.3:1.1
--- /dev/null	Sat Oct 19 15:56:56 2013
+++ src/lib/libc/net/inet6_getscopeid.3	Sat Oct 19 15:56:56 2013
@@ -0,0 +1,83 @@
+.\	$NetBSD: inet6_getscopeid.3,v 1.1 2013/10/19 19:56:56 christos Exp $
+.\-
+.\ Copyright (c) 2003 The NetBSD Foundation, Inc.
+.\ All rights reserved.
+.\
+.\ This code is derived from software contributed to The NetBSD Foundation
+.\ by Christos Zoulas.
+.\
+.\ 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.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS
+.\ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\ POSSIBILITY OF SUCH DAMAGE.
+.\
+.\
+.Dd October 19, 2013
+.Dt INET6_GETSCOPEID 3
+.Os
+.\
+.Sh NAME
+.Nm inet6_getscopeid ,
+.Nm inet6_putscopeid 
+.Nd IPv6 scope id encoding and decoding functions
+.\
+.Sh SYNOPSIS
+.In netinet/in.h
+.Ft void
+.Fn inet6_getscopeid struct sockaddr_in6 *sin6 int flags
+.Ft void
+.Fn inet6_putscopeid struct sockaddr_in6 *sin6 int flags
+.\
+.Sh DESCRIPTION
+These functions implement a KAME-specific extension that encodes and
+decodes the scope id inside in the 3rd and 4th byte of the address,
+for link-local, site-local, and multicast-link-local addresses.
+Typically those two bytes are
+.Dv 0
+for these kinds of addresses.
+The scope id is stored in network byte order.
+.Pp
+The
+.Fn inet6_getscopeid
+function retrieves the scope id from the 3rd and the 4th address bytes,
+and sets the
+.Ft sin6_scope_id
+from them.
+It then clears the two address bytes.
+.Pp
+The
+.Fn inet6putscopeid
+function stores the scope id found in
+.Ft sin6_scope_id
+into the 3rd and 4th byte of the address.
+It then clears the
+.Ft sin6_scope_id
+.Pp
+The
+.Fa flags
+argument controls for which addresses this action is performed. It
+can be a combination of:
+.Bl -tag -width INET6_IS_ADDR_MC_LINKLOCAL
+.It Dv INET6_IS_ADDR_LINKLOCAL
+.It Dv INET6_IS_ADDR_MC_LINKLOCAL
+.It Dv INET6_IS_ADDR_SITELOCAL
+.El
+.Sh HISTORY
+These functions first appeared in
+.Nx 7 .



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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 19:59:05 UTC 2013

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

Log Message:
add new scopeid function docs


To generate a diff of this commit:
cvs rdiff -u -r1.1845 -r1.1846 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1845 src/distrib/sets/lists/comp/mi:1.1846
--- src/distrib/sets/lists/comp/mi:1.1845	Thu Oct 17 12:52:02 2013
+++ src/distrib/sets/lists/comp/mi	Sat Oct 19 15:59:05 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1845 2013/10/17 16:52:02 christos Exp $
+#	$NetBSD: mi,v 1.1846 2013/10/19 19:59:05 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -6055,6 +6055,7 @@
 ./usr/share/man/cat3/inchstr.0			comp-c-catman		.cat
 ./usr/share/man/cat3/index.0			comp-c-catman		.cat
 ./usr/share/man/cat3/inet.0			comp-c-catman		.cat
+./usr/share/man/cat3/inet6_getscopeid.0		comp-c-catman		.cat
 ./usr/share/man/cat3/inet6_opt_append.0		comp-c-catman		.cat
 ./usr/share/man/cat3/inet6_opt_find.0		comp-c-catman		.cat
 ./usr/share/man/cat3/inet6_opt_finish.0		comp-c-catman		.cat
@@ -6068,6 +6069,7 @@
 ./usr/share/man/cat3/inet6_option_init.0	comp-c-catman		.cat
 ./usr/share/man/cat3/inet6_option_next.0	comp-c-catman		.cat
 ./usr/share/man/cat3/inet6_option_space.0	comp-c-catman		.cat
+./usr/share/man/cat3/inet6_putscopeid.0		comp-c-catman		.cat
 ./usr/share/man/cat3/inet6_rth_add.0		comp-c-catman		.cat
 ./usr/share/man/cat3/inet6_rth_getaddr.0	comp-c-catman		.cat
 ./usr/share/man/cat3/inet6_rth_init.0		comp-c-catman		.cat
@@ -12599,6 +12601,7 @@
 ./usr/share/man/html3/inchstr.html		comp-c-htmlman		html
 ./usr/share/man/html3/index.html		comp-c-htmlman		html
 ./usr/share/man/html3/inet.html			comp-c-htmlman		html
+./usr/share/man/html3/inet6_getscopeid.html	comp-c-htmlman		html
 ./usr/share/man/html3/inet6_opt_append.html	comp-c-htmlman		html
 ./usr/share/man/html3/inet6_opt_find.html	comp-c-htmlman		html
 ./usr/share/man/html3/inet6_opt_finish.html	comp-c-htmlman		html
@@ -12612,6 +12615,7 @@
 ./usr/share/man/html3/inet6_option_init.html	comp-c-htmlman		html
 ./usr/share/man/html3/inet6_option_next.html	comp-c-htmlman		html
 ./usr/share/man/html3/inet6_option_space.html	comp-c-htmlman		html
+./usr/share/man/html3/inet6_putscopeid.html	comp-c-htmlman		html
 ./usr/share/man/html3/inet6_rth_add.html	comp-c-htmlman		html
 ./usr/share/man/html3/inet6_rth_getaddr.html	comp-c-htmlman		html
 ./usr/share/man/html3/inet6_rth_init.html	comp-c-htmlman		html
@@ -19063,6 +19067,7 @@
 ./usr/share/man/man3/inchstr.3			comp-c-man		.man
 ./usr/share/man/man3/index.3			comp-c-man		.man
 ./usr/share/man/man3/inet.3			comp-c-man		.man
+./usr/share/man/man3/inet6_getscopeid.3		comp-c-man		.man
 ./usr/share/man/man3/inet6_opt_append.3		comp-c-man		.man
 ./usr/share/man/man3/inet6_opt_find.3		comp-c-man		.man
 ./usr/share/man/man3/inet6_opt_finish.3		comp-c-man		.man
@@ -19076,6 +19081,7 @@
 ./usr/share/man/man3/inet6_option_init.3	comp-c-man		.man
 ./usr/share/man/man3/inet6_option_next.3	comp-c-man		.man
 ./usr/share/man/man3/inet6_option_space.3	comp-c-man		.man
+./usr/share/man/man3/inet6_putscopeid.3		comp-c-man		.man
 ./usr/share/man/man3/inet6_rth_add.3		comp-c-man		.man
 ./usr/share/man/man3/inet6_rth_getaddr.3	comp-c-man		.man
 ./usr/share/man/man3/inet6_rth_init.3		comp-c-man		.man



CVS commit: src/sys/ufs/ufs

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 20:12:18 UTC 2013

Modified Files:
src/sys/ufs/ufs: ufs_bswap.h

Log Message:
convert ufs_rw{16,32,64}() into real inline functions in all cases,
so that they consume their second arguments properly.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/ufs/ufs/ufs_bswap.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/ufs/ufs/ufs_bswap.h
diff -u src/sys/ufs/ufs/ufs_bswap.h:1.19 src/sys/ufs/ufs/ufs_bswap.h:1.20
--- src/sys/ufs/ufs/ufs_bswap.h:1.19	Mon Oct 19 18:41:17 2009
+++ src/sys/ufs/ufs/ufs_bswap.h	Sat Oct 19 20:12:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_bswap.h,v 1.19 2009/10/19 18:41:17 bouyer Exp $	*/
+/*	$NetBSD: ufs_bswap.h,v 1.20 2013/10/19 20:12:18 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998 Manuel Bouyer.
@@ -65,9 +65,23 @@ ufs_rw64(uint64_t a, int ns)
 	return ((ns) ? bswap64(a) : (a));
 }
 #else
-#define ufs_rw16(a, ns) ((uint16_t)(a))
-#define ufs_rw32(a, ns) ((uint32_t)(a))
-#define ufs_rw64(a, ns) ((uint64_t)(a))
+static inline u_int16_t
+ufs_rw16(uint16_t a, int ns)
+{
+	return a;
+}
+
+static inline u_int32_t
+ufs_rw32(uint32_t a, int ns)
+{
+	return a;
+}
+
+static inline u_int64_t
+ufs_rw64(uint64_t a, int ns)
+{
+	return a;
+}
 #endif
 
 #define ufs_add16(a, b, ns) \



CVS commit: src/usr.sbin/makefs

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 20:49:22 UTC 2013

Modified Files:
src/usr.sbin/makefs: cd9660.c

Log Message:
avoid using __USE() in the tools version of this.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.sbin/makefs/cd9660.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.sbin/makefs/cd9660.c
diff -u src/usr.sbin/makefs/cd9660.c:1.45 src/usr.sbin/makefs/cd9660.c:1.46
--- src/usr.sbin/makefs/cd9660.c:1.45	Sat Oct 19 17:16:37 2013
+++ src/usr.sbin/makefs/cd9660.c	Sat Oct 19 20:49:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660.c,v 1.45 2013/10/19 17:16:37 christos Exp $	*/
+/*	$NetBSD: cd9660.c,v 1.46 2013/10/19 20:49:22 mrg Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -103,7 +103,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: cd9660.c,v 1.45 2013/10/19 17:16:37 christos Exp $);
+__RCSID($NetBSD: cd9660.c,v 1.46 2013/10/19 20:49:22 mrg Exp $);
 #endif  /* !__lint */
 
 #include string.h
@@ -1133,7 +1133,7 @@ cd9660_rename_filename(iso9660_disk *dis
 }
 			}
 		}
-#else
+#elif !HAVE_NBTOOL_CONFIG_H
 		__USE(dot);
 		__USE(semi);
 		__USE(multiplier);



CVS commit: src/sys/dev

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 21:00:32 UTC 2013

Modified Files:
src/sys/dev/sbus: agten.c dbri.c magma.c
src/sys/dev/vme: xd.c xy.c

Log Message:
- remove set but unused variable.
- put variables only inside #ifdef inside that same #ifdef.
  use __USE() where appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sbus/agten.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/sbus/dbri.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/sbus/magma.c
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/vme/xd.c
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/vme/xy.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/sbus/agten.c
diff -u src/sys/dev/sbus/agten.c:1.31 src/sys/dev/sbus/agten.c:1.32
--- src/sys/dev/sbus/agten.c:1.31	Tue Jul 30 19:24:26 2013
+++ src/sys/dev/sbus/agten.c	Sat Oct 19 21:00:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: agten.c,v 1.31 2013/07/30 19:24:26 macallan Exp $ */
+/*	$NetBSD: agten.c,v 1.32 2013/10/19 21:00:32 mrg Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: agten.c,v 1.31 2013/07/30 19:24:26 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: agten.c,v 1.32 2013/10/19 21:00:32 mrg Exp $);
 
 /*
  * a driver for the Fujitsu AG-10e SBus framebuffer
@@ -618,7 +618,6 @@ agten_init(struct agten_softc *sc)
 {
 	int i;
 	uint32_t src, srcw;
-	volatile uint32_t junk;
 
 	/* then we set up a linear LUT for 24bit colour */
 	agten_write_idx(sc, IBM561_CMAP_TABLE + 256);
@@ -683,7 +682,7 @@ agten_init(struct agten_softc *sc)
 	bus_space_write_4(sc-sc_bustag, sc-sc_p9100_regh, COORD_INDEX, 0);
 	bus_space_write_4(sc-sc_bustag, sc-sc_p9100_regh, RECT_RTW_XY, src);
 	bus_space_write_4(sc-sc_bustag, sc-sc_p9100_regh, RECT_RTW_XY, srcw);
-	junk = bus_space_read_4(sc-sc_bustag, sc-sc_p9100_regh, COMMAND_QUAD);
+	(void)bus_space_read_4(sc-sc_bustag, sc-sc_p9100_regh, COMMAND_QUAD);
 
 	/* initialize the cursor registers */
 	

Index: src/sys/dev/sbus/dbri.c
diff -u src/sys/dev/sbus/dbri.c:1.34 src/sys/dev/sbus/dbri.c:1.35
--- src/sys/dev/sbus/dbri.c:1.34	Wed Nov 23 23:07:36 2011
+++ src/sys/dev/sbus/dbri.c	Sat Oct 19 21:00:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbri.c,v 1.34 2011/11/23 23:07:36 jmcneill Exp $	*/
+/*	$NetBSD: dbri.c,v 1.35 2013/10/19 21:00:32 mrg Exp $	*/
 
 /*
  * Copyright (C) 1997 Rudolf Koenig (rfkoe...@immd4.informatik.uni-erlangen.de)
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.34 2011/11/23 23:07:36 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: dbri.c,v 1.35 2013/10/19 21:00:32 mrg Exp $);
 
 #include audio.h
 #if NAUDIO  0
@@ -1270,8 +1270,10 @@ setup_ring_xmit(struct dbri_softc *sc, i
 {
 	volatile uint32_t *cmd;
 	int i;
+#if 0
 	int td;
 	int td_first, td_last;
+#endif
 	bus_addr_t dmabuf, dmabase;
 	struct dbri_desc *dd = sc-sc_desc[which];
 
@@ -1285,8 +1287,10 @@ setup_ring_xmit(struct dbri_softc *sc, i
 			return;
 	}
  
+#if 0
 	td = 0;
 	td_first = td_last = -1;
+#endif
 
 	if (sc-sc_pipe[pipe].sdp == 0) {
 		aprint_error_dev(sc-sc_dev, uninitialized pipe %d\n,
@@ -1296,7 +1300,6 @@ setup_ring_xmit(struct dbri_softc *sc, i
 
 	dmabuf = dd-dmabase;
 	dmabase = sc-sc_dmabase;
-	td = 0;
 
 	for (i = 0; i  (num - 1); i++) {
 
@@ -1306,7 +1309,9 @@ setup_ring_xmit(struct dbri_softc *sc, i
 		sc-sc_dma-xmit[i].nda = dmabase + dbri_dma_off(xmit, i + 1);
 		sc-sc_dma-xmit[i].status = 0;
 
+#if 0
 		td_last = td;
+#endif
 		dmabuf += blksz;
 	}
 
@@ -1366,7 +1371,9 @@ setup_ring_recv(struct dbri_softc *sc, i
 {
 	volatile uint32_t *cmd;
 	int i;
+#if 0
 	int td_first, td_last;
+#endif
 	bus_addr_t dmabuf, dmabase;
 	struct dbri_desc *dd = sc-sc_desc[which];
 
@@ -1379,7 +1386,9 @@ setup_ring_recv(struct dbri_softc *sc, i
 			return;
 	}
  
+#if 0
 	td_first = td_last = -1;
+#endif
 
 	if (sc-sc_pipe[pipe].sdp == 0) {
 		aprint_error_dev(sc-sc_dev, uninitialized pipe %d\n,
@@ -1397,7 +1406,9 @@ setup_ring_recv(struct dbri_softc *sc, i
 		sc-sc_dma-recv[i].nda = dmabase + dbri_dma_off(recv, i + 1);
 		sc-sc_dma-recv[i].status = RX_EOF;
 
+#if 0
 		td_last = i;
+#endif
 		dmabuf += blksz;
 	}
 

Index: src/sys/dev/sbus/magma.c
diff -u src/sys/dev/sbus/magma.c:1.56 src/sys/dev/sbus/magma.c:1.57
--- src/sys/dev/sbus/magma.c:1.56	Sat Oct 27 17:18:37 2012
+++ src/sys/dev/sbus/magma.c	Sat Oct 19 21:00:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: magma.c,v 1.56 2012/10/27 17:18:37 chs Exp $	*/
+/*	$NetBSD: magma.c,v 1.57 2013/10/19 21:00:32 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998 Iain Hibbert
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: magma.c,v 1.56 2012/10/27 17:18:37 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: magma.c,v 1.57 2013/10/19 21:00:32 mrg Exp $);
 
 #if 0
 #define MAGMA_DEBUG
@@ -618,11 +618,9 @@ magma_hard(void *arg)
 			}
 		} else {		/* serial port */
 			struct mtty_port *mtty;
-			struct tty 

CVS commit: src/sys

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 21:01:40 UTC 2013

Modified Files:
src/sys/dev/wscons: wsemul_vt100.c
src/sys/kern: kern_acct.c kern_mutex.c kern_rwlock.c

Log Message:
use __USE() where appropriate.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/wscons/wsemul_vt100.c
cvs rdiff -u -r1.93 -r1.94 src/sys/kern/kern_acct.c
cvs rdiff -u -r1.57 -r1.58 src/sys/kern/kern_mutex.c
cvs rdiff -u -r1.41 -r1.42 src/sys/kern/kern_rwlock.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/wscons/wsemul_vt100.c
diff -u src/sys/dev/wscons/wsemul_vt100.c:1.35 src/sys/dev/wscons/wsemul_vt100.c:1.36
--- src/sys/dev/wscons/wsemul_vt100.c:1.35	Thu Feb 11 10:07:14 2010
+++ src/sys/dev/wscons/wsemul_vt100.c	Sat Oct 19 21:01:39 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemul_vt100.c,v 1.35 2010/02/11 10:07:14 drochner Exp $ */
+/* $NetBSD: wsemul_vt100.c,v 1.36 2013/10/19 21:01:39 mrg Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wsemul_vt100.c,v 1.35 2010/02/11 10:07:14 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: wsemul_vt100.c,v 1.36 2013/10/19 21:01:39 mrg Exp $);
 
 #include opt_wsmsgattrs.h
 
@@ -1037,7 +1037,9 @@ wsemul_vt100_setmsgattrs(void *cookie, c
 	   vd-msgattrs.default_bg,
 	   vd-msgattrs.default_attrs,
 	   tmp);
-#ifdef VT100_DEBUG
+#ifndef VT100_DEBUG
+	__USE(error);
+#else
 	if (error)
 		printf(vt100: failed to allocate attribute for default 
 		   messages\n);

Index: src/sys/kern/kern_acct.c
diff -u src/sys/kern/kern_acct.c:1.93 src/sys/kern/kern_acct.c:1.94
--- src/sys/kern/kern_acct.c:1.93	Sat Sep  3 14:09:03 2011
+++ src/sys/kern/kern_acct.c	Sat Oct 19 21:01:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_acct.c,v 1.93 2011/09/03 14:09:03 christos Exp $	*/
+/*	$NetBSD: kern_acct.c,v 1.94 2013/10/19 21:01:39 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_acct.c,v 1.93 2011/09/03 14:09:03 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_acct.c,v 1.94 2013/10/19 21:01:39 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -224,6 +224,8 @@ acct_stop(void)
 		if (error != 0)
 			printf(acct_stop: failed to close, errno = %d\n,
 			error);
+#else
+		__USE(error);
 #endif
 		acct_vp = NULLVP;
 	}
@@ -259,6 +261,8 @@ acctwatch(void *arg)
 		if (error != 0)
 			printf(acctwatch: failed to statvfs, error = %d\n,
 			error);
+#else
+		__USE(error);
 #endif
 		rw_exit(acct_lock);
 		error = kpause(actwat, false, acctchkfreq * hz, NULL);

Index: src/sys/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.57 src/sys/kern/kern_mutex.c:1.58
--- src/sys/kern/kern_mutex.c:1.57	Sun Sep 22 14:59:07 2013
+++ src/sys/kern/kern_mutex.c	Sat Oct 19 21:01:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.57 2013/09/22 14:59:07 joerg Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.58 2013/10/19 21:01:39 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_mutex.c,v 1.57 2013/09/22 14:59:07 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_mutex.c,v 1.58 2013/10/19 21:01:39 mrg Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -711,6 +711,9 @@ mutex_vector_exit(kmutex_t *mtx)
 	MUTEX_DASSERT(mtx, curthread != 0);
 	MUTEX_ASSERT(mtx, MUTEX_OWNER(mtx-mtx_owner) == curthread);
 	MUTEX_UNLOCKED(mtx);
+#if !defined(LOCKDEBUG)
+	__USE(curthread);
+#endif
 
 #ifdef LOCKDEBUG
 	/*

Index: src/sys/kern/kern_rwlock.c
diff -u src/sys/kern/kern_rwlock.c:1.41 src/sys/kern/kern_rwlock.c:1.42
--- src/sys/kern/kern_rwlock.c:1.41	Wed Sep  4 10:16:16 2013
+++ src/sys/kern/kern_rwlock.c	Sat Oct 19 21:01:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rwlock.c,v 1.41 2013/09/04 10:16:16 skrll Exp $	*/
+/*	$NetBSD: kern_rwlock.c,v 1.42 2013/10/19 21:01:39 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rwlock.c,v 1.41 2013/09/04 10:16:16 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rwlock.c,v 1.42 2013/10/19 21:01:39 mrg Exp $);
 
 #define	__RWLOCK_PRIVATE
 
@@ -580,6 +580,10 @@ rw_downgrade(krwlock_t *rw)
 	RW_DASSERT(rw, (rw-rw_owner  RW_WRITE_LOCKED) != 0);
 	RW_ASSERT(rw, RW_OWNER(rw) == curthread);
 	RW_UNLOCKED(rw, RW_WRITER);
+#if !defined(DIAGNOSTIC)
+	__USE(curthread);
+#endif
+
 
 	membar_producer();
 	owner = rw-rw_owner;



CVS commit: src/sys/net

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 21:39:12 UTC 2013

Modified Files:
src/sys/net: if.c

Log Message:
adjust previous; old_link_state is also used in INET6.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.269 src/sys/net/if.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/net/if.c
diff -u src/sys/net/if.c:1.268 src/sys/net/if.c:1.269
--- src/sys/net/if.c:1.268	Sat Oct 19 18:39:30 2013
+++ src/sys/net/if.c	Sat Oct 19 21:39:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.268 2013/10/19 18:39:30 martin Exp $	*/
+/*	$NetBSD: if.c,v 1.269 2013/10/19 21:39:12 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if.c,v 1.268 2013/10/19 18:39:30 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: if.c,v 1.269 2013/10/19 21:39:12 mrg Exp $);
 
 #include opt_inet.h
 
@@ -1324,7 +1324,7 @@ void
 if_link_state_change(struct ifnet *ifp, int link_state)
 {
 	int s;
-#ifdef DEBUG
+#if defined(DEBUG) || defined(INET6)
 	int old_link_state;
 #endif
 
@@ -1334,7 +1334,7 @@ if_link_state_change(struct ifnet *ifp, 
 		return;
 	}
 
-#ifdef DEBUG
+#if defined(DEBUG) || defined(INET6)
 	old_link_state = ifp-if_link_state;
 #endif
 	ifp-if_link_state = link_state;



CVS commit: src

2013-10-19 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct 19 22:35:02 UTC 2013

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base

Log Message:
add missing chroot directories for rtadvd


To generate a diff of this commit:
cvs rdiff -u -r1.1040 -r1.1041 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.124 -r1.125 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1040 src/distrib/sets/lists/base/mi:1.1041
--- src/distrib/sets/lists/base/mi:1.1040	Wed Aug 21 20:51:57 2013
+++ src/distrib/sets/lists/base/mi	Sat Oct 19 22:35:02 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1040 2013/08/21 20:51:57 tron Exp $
+# $NetBSD: mi,v 1.1041 2013/10/19 22:35:02 mlelstv Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -5439,6 +5439,10 @@
 ./var/chroot/pflogdbase-sys-root
 ./var/chroot/pfspamdbase-obsolete		obsolete
 ./var/chroot/spamdbase-obsolete		obsolete
+./var/chroot/rtadvdbase-sys-root
+./var/chroot/rtadvd/etcbase-sys-root
+./var/chroot/rtadvd/varbase-sys-root
+./var/chroot/rtadvd/var/run			base-sys-root
 ./var/chroot/sshdbase-sys-root
 ./var/chroot/tcpdumpbase-sys-root
 ./var/chroot/tcpdump/etc			base-obsolete		obsolete

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.124 src/etc/mtree/NetBSD.dist.base:1.125
--- src/etc/mtree/NetBSD.dist.base:1.124	Thu Aug 22 07:14:38 2013
+++ src/etc/mtree/NetBSD.dist.base	Sat Oct 19 22:35:02 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.124 2013/08/22 07:14:38 tron Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.125 2013/10/19 22:35:02 mlelstv Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1248,6 +1248,10 @@
 ./var/chroot/ntpd/var/db	mode=0775 gname=ntpd
 ./var/chroot/ntpd/var/run	mode=0775 gname=ntpd
 ./var/chroot/pflogd		mode=0755
+./var/chroot/rtadvd		type=dir  mode=0755
+./var/chroot/rtadvd/etc		type=dir  mode=0755
+./var/chroot/rtadvd/var		type=dir  mode=0755
+./var/chroot/rtadvd/var/run	type=dir  mode=0775 gname=_rtadvd
 ./var/chroot/sshd		mode=0755
 ./var/chroot/tcpdump		mode=0755
 ./var/chroot/tftp-proxy		mode=0755



CVS commit: src/sys/kern

2013-10-19 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct 19 22:36:57 UTC 2013

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

Log Message:
use 64bit arithmetic to compute sectors-per-unit


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/kern/subr_disk.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/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.102 src/sys/kern/subr_disk.c:1.103
--- src/sys/kern/subr_disk.c:1.102	Wed May 29 00:47:49 2013
+++ src/sys/kern/subr_disk.c	Sat Oct 19 22:36:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disk.c,v 1.102 2013/05/29 00:47:49 christos Exp $	*/
+/*	$NetBSD: subr_disk.c,v 1.103 2013/10/19 22:36:57 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_disk.c,v 1.102 2013/05/29 00:47:49 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_disk.c,v 1.103 2013/10/19 22:36:57 mlelstv Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -529,7 +529,7 @@ disk_set_info(device_t dev, struct disk 
 #endif
 			return;
 		}
-		dg-dg_secperunit = dg-dg_nsectors *
+		dg-dg_secperunit = (int64_t) dg-dg_nsectors *
 		dg-dg_ntracks * dg-dg_ncylinders;
 	}
 



CVS commit: src/sys/dev/sdmmc

2013-10-19 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Oct 19 22:45:12 UTC 2013

Modified Files:
src/sys/dev/sdmmc: sdmmcdevs

Log Message:
add Ricoh MMC reader


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/sdmmc/sdmmcdevs

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/sdmmc/sdmmcdevs
diff -u src/sys/dev/sdmmc/sdmmcdevs:1.1 src/sys/dev/sdmmc/sdmmcdevs:1.2
--- src/sys/dev/sdmmc/sdmmcdevs:1.1	Tue Apr 21 03:00:31 2009
+++ src/sys/dev/sdmmc/sdmmcdevs	Sat Oct 19 22:45:12 2013
@@ -1,4 +1,4 @@
-	$NetBSD: sdmmcdevs,v 1.1 2009/04/21 03:00:31 nonaka Exp $
+	$NetBSD: sdmmcdevs,v 1.2 2013/10/19 22:45:12 mlelstv Exp $
 /*	$OpenBSD: sdmmcdevs,v 1.8 2007/05/11 17:16:16 mglocker Exp $	*/
 
 /*
@@ -28,6 +28,7 @@ vendor SYCHIP			0x02db	SyChip Inc.
 vendor SPECTEC			0x02fe	Spectec Computer Co., Ltd
 vendor MEDIATEK			0x037a	MediaTek Inc.
 vendor GLOBALSAT		0x0501	Globalsat Technology Co.
+vendor RICOH0x1180  Ricoh
 vendor ABOCOM			0x13d1	AboCom Systems, Inc.
 
 /*
@@ -68,3 +69,6 @@ product TOSHIBA SDBTCARD3	0x0003	Toshiba
 /* Socket Communications, Inc. */
 product SOCKETCOM SDSCANNER	0x005e	Socket SD Scanner
 product SOCKETCOM BTCARD	0x00c5	Socket BT Card
+
+/* Ricoh */
+product RICOH MMCREADER		0xe823  MMC card reader



CVS commit: src/crypto/external/bsd/netpgp/dist/src/libdigest

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 22:54:44 UTC 2013

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libdigest: tiger.c

Log Message:
avoid casts when the necessary union member is already available.
from apb.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/netpgp/dist/src/libdigest/tiger.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libdigest/tiger.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libdigest/tiger.c:1.2 src/crypto/external/bsd/netpgp/dist/src/libdigest/tiger.c:1.3
--- src/crypto/external/bsd/netpgp/dist/src/libdigest/tiger.c:1.2	Tue Nov 20 05:26:25 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libdigest/tiger.c	Sat Oct 19 22:54:44 2013
@@ -819,7 +819,7 @@ TIGER_Update(TIGER_CTX *ctx, const void 
 	for (; j  56; j++) {
 		u.temp8[j] = 0;
 	}
-	((uint64_t *)(void *)((u.temp8[56])))[0] = ((uint64_t)length)  3;
+	u.temp64[7] = ((uint64_t)length)  3;
 	tiger_compress(u.temp64, ctx-ctx);
 }
 



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

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 22:55:01 UTC 2013

Modified Files:
src/external/bsd/libdwarf/dist: dwarf_init.c dwarf_loc.c

Log Message:
remove set but unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libdwarf/dist/dwarf_init.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libdwarf/dist/dwarf_loc.c

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

Modified files:

Index: src/external/bsd/libdwarf/dist/dwarf_init.c
diff -u src/external/bsd/libdwarf/dist/dwarf_init.c:1.4 src/external/bsd/libdwarf/dist/dwarf_init.c:1.5
--- src/external/bsd/libdwarf/dist/dwarf_init.c:1.4	Thu Jan 17 22:06:58 2013
+++ src/external/bsd/libdwarf/dist/dwarf_init.c	Sat Oct 19 22:55:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwarf_init.c,v 1.4 2013/01/17 22:06:58 christos Exp $	*/
+/*	$NetBSD: dwarf_init.c,v 1.5 2013/10/19 22:55:01 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2007 John Birrell (j...@freebsd.org)
@@ -468,7 +468,6 @@ dwarf_init_info(Dwarf_Debug dbg, Dwarf_E
 {
 	Dwarf_CU cu;
 	Elf_Data *d = NULL;
-	Elf_Scn *scn;
 	int i;
 	int level = 0;
 	int relocated = 0;
@@ -477,8 +476,6 @@ dwarf_init_info(Dwarf_Debug dbg, Dwarf_E
 	uint64_t next_offset;
 	uint64_t offset = 0;
 
-	scn = dbg-dbg_s[DWARF_debug_info].s_scn;
-
 	d = dbg-dbg_s[DWARF_debug_info].s_data;
 
 	while (offset  d-d_size) {

Index: src/external/bsd/libdwarf/dist/dwarf_loc.c
diff -u src/external/bsd/libdwarf/dist/dwarf_loc.c:1.3 src/external/bsd/libdwarf/dist/dwarf_loc.c:1.4
--- src/external/bsd/libdwarf/dist/dwarf_loc.c:1.3	Thu Jan 17 22:06:58 2013
+++ src/external/bsd/libdwarf/dist/dwarf_loc.c	Sat Oct 19 22:55:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwarf_loc.c,v 1.3 2013/01/17 22:06:58 christos Exp $	*/
+/*	$NetBSD: dwarf_loc.c,v 1.4 2013/10/19 22:55:01 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2007 John Birrell (j...@freebsd.org)
@@ -93,8 +93,6 @@ int
 dwarf_op_num(uint8_t pointer_size, uint8_t *p, int len)
 {
 	int count = 0;
-	int64_t sval;
-	uint64_t uval;
 	uint8_t *last = p + len;
 
 	/*
@@ -242,7 +240,6 @@ dwarf_op_num(uint8_t pointer_size, uint8
 		case DW_OP_plus_uconst:
 		case DW_OP_regx:
 		case DW_OP_piece:
-			uval = dwarf_decode_uleb128(p);
 			break;
 
 		/* Operations with a signed LEB128 operand. */
@@ -280,7 +277,6 @@ dwarf_op_num(uint8_t pointer_size, uint8
 		case DW_OP_breg30:
 		case DW_OP_breg31:
 		case DW_OP_fbreg:
-			sval = dwarf_decode_sleb128(p);
 			break;
 
 		/*
@@ -288,8 +284,6 @@ dwarf_op_num(uint8_t pointer_size, uint8
 		 * followed by a signed LEB128 operand.
 		 */
 		case DW_OP_bregx:
-			uval = dwarf_decode_uleb128(p);
-			sval = dwarf_decode_sleb128(p);
 			break;
 
 		/* Target address size operand. */



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

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 22:55:13 UTC 2013

Modified Files:
src/external/bsd/libarchive/dist/libarchive:
archive_write_set_format_shar.c

Log Message:
actually use the copied tmp_buf, for 3 byte-unaligned uudecode.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/libarchive/dist/libarchive/archive_write_set_format_shar.c

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

Modified files:

Index: src/external/bsd/libarchive/dist/libarchive/archive_write_set_format_shar.c
diff -u src/external/bsd/libarchive/dist/libarchive/archive_write_set_format_shar.c:1.1.1.2 src/external/bsd/libarchive/dist/libarchive/archive_write_set_format_shar.c:1.2
--- src/external/bsd/libarchive/dist/libarchive/archive_write_set_format_shar.c:1.1.1.2	Sat Feb 20 02:48:40 2010
+++ src/external/bsd/libarchive/dist/libarchive/archive_write_set_format_shar.c	Sat Oct 19 22:55:13 2013
@@ -409,7 +409,7 @@ uuencode_group(const char _in[3], char o
 static void
 uuencode_line(struct shar *shar, const char *inbuf, size_t len)
 {
-	char tmp_buf[3], *buf;
+	char *buf;
 	size_t alloc_len;
 
 	/* len = 45 - expanded to 60 + len byte + new line */
@@ -426,13 +426,15 @@ uuencode_line(struct shar *shar, const c
 		buf += 4;
 	}
 	if (len != 0) {
+		char tmp_buf[3];
+
 		tmp_buf[0] = inbuf[0];
 		if (len == 1)
 			tmp_buf[1] = '\0';
 		else
 			tmp_buf[1] = inbuf[1];
 		tmp_buf[2] = '\0';
-		uuencode_group(inbuf, buf);
+		uuencode_group(tmp_buf, buf);
 		buf += 4;
 	}
 	*buf++ = '\n';



CVS commit: src/lib/libpam/modules/pam_deny

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 22:57:46 UTC 2013

Modified Files:
src/lib/libpam/modules/pam_deny: pam_deny.c

Log Message:
remove useless variable


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libpam/modules/pam_deny/pam_deny.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/libpam/modules/pam_deny/pam_deny.c
diff -u src/lib/libpam/modules/pam_deny/pam_deny.c:1.3 src/lib/libpam/modules/pam_deny/pam_deny.c:1.4
--- src/lib/libpam/modules/pam_deny/pam_deny.c:1.3	Tue Aug 20 22:07:44 2013
+++ src/lib/libpam/modules/pam_deny/pam_deny.c	Sat Oct 19 22:57:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_deny.c,v 1.3 2013/08/20 22:07:44 perseant Exp $	*/
+/*	$NetBSD: pam_deny.c,v 1.4 2013/10/19 22:57:46 mrg Exp $	*/
 
 /*-
  * Copyright 2001 Mark R V Murray
@@ -30,7 +30,7 @@
 #ifdef __FreeBSD__
 __FBSDID($FreeBSD: src/lib/libpam/modules/pam_deny/pam_deny.c,v 1.9 2002/04/12 22:27:19 des Exp $);
 #else
-__RCSID($NetBSD: pam_deny.c,v 1.3 2013/08/20 22:07:44 perseant Exp $);
+__RCSID($NetBSD: pam_deny.c,v 1.4 2013/10/19 22:57:46 mrg Exp $);
 #endif
 
 #include stddef.h
@@ -78,14 +78,14 @@ PAM_EXTERN int
 pam_sm_chauthtok(pam_handle_t *pamh __unused, int flags,
 int argc, const char *argv[])
 {
-	int prelim_ignore = 0, debug = 0;
+	int prelim_ignore = 0;
 	int i;
 
 	for (i = 0; i  argc; i++) {
 		if (strcmp(argv[i], prelim_ignore) == 0)
 			prelim_ignore = 1;
 		else if (strcmp(argv[i], debug) == 0)
-			debug = 1;
+			/* nothing */;
 		else
 			syslog(LOG_ERR, illegal option %s, argv[i]);
 	}



CVS commit: src/external/bsd/fetch/dist/libfetch

2013-10-19 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Oct 19 22:58:40 UTC 2013

Modified Files:
src/external/bsd/fetch/dist/libfetch: ftp.c

Log Message:
avoid a strict aliasing problem copying the mapped v4 address out of
a ipv6 address.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/fetch/dist/libfetch/ftp.c

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

Modified files:

Index: src/external/bsd/fetch/dist/libfetch/ftp.c
diff -u src/external/bsd/fetch/dist/libfetch/ftp.c:1.5 src/external/bsd/fetch/dist/libfetch/ftp.c:1.6
--- src/external/bsd/fetch/dist/libfetch/ftp.c:1.5	Wed Aug 17 09:19:38 2011
+++ src/external/bsd/fetch/dist/libfetch/ftp.c	Sat Oct 19 22:58:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftp.c,v 1.5 2011/08/17 09:19:38 christos Exp $	*/
+/*	$NetBSD: ftp.c,v 1.6 2013/10/19 22:58:40 mrg Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger jo...@netbsd.org
@@ -138,6 +138,7 @@ static void
 unmappedaddr(struct sockaddr_in6 *sin6, socklen_t *len)
 {
 	struct sockaddr_in *sin4;
+	void *addrp;
 	uint32_t addr;
 	int port;
 
@@ -145,7 +146,8 @@ unmappedaddr(struct sockaddr_in6 *sin6, 
 	!IN6_IS_ADDR_V4MAPPED(sin6-sin6_addr))
 		return;
 	sin4 = (struct sockaddr_in *)(void *)sin6;
-	addr = *(uint32_t *)(void *)sin6-sin6_addr.s6_addr[12];
+	addrp = sin6-sin6_addr.s6_addr[12];
+	addr = *(uint32_t *)addrp;
 	port = sin6-sin6_port;
 	memset(sin4, 0, sizeof(struct sockaddr_in));
 	sin4-sin_addr.s_addr = addr;



CVS commit: src/external/cddl/osnet/dist/lib/libnvpair

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 23:07:39 UTC 2013

Modified Files:
src/external/cddl/osnet/dist/lib/libnvpair: libnvpair.c

Log Message:
use proper format strings.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/cddl/osnet/dist/lib/libnvpair/libnvpair.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/cddl/osnet/dist/lib/libnvpair/libnvpair.c
diff -u src/external/cddl/osnet/dist/lib/libnvpair/libnvpair.c:1.2 src/external/cddl/osnet/dist/lib/libnvpair/libnvpair.c:1.3
--- src/external/cddl/osnet/dist/lib/libnvpair/libnvpair.c:1.2	Thu Jan  3 11:41:51 2013
+++ src/external/cddl/osnet/dist/lib/libnvpair/libnvpair.c	Sat Oct 19 19:07:39 2013
@@ -128,13 +128,13 @@ nvlist_print_with_indent(FILE *fp, nvlis
 		case DATA_TYPE_INT64: {
 			int64_t val;
 			(void) nvpair_value_int64(nvp, val);
-			(void) fprintf(fp,  %lld, (longlong_t)val);
+			(void) fprintf(fp,  % PRId64 , val);
 			break;
 		}
 		case DATA_TYPE_UINT64: {
 			uint64_t val;
 			(void) nvpair_value_uint64(nvp, val);
-			(void) fprintf(fp,  0x%llx, (u_longlong_t)val);
+			(void) fprintf(fp,  0x% PRIx64, val);
 			break;
 		}
 		case DATA_TYPE_DOUBLE: {
@@ -209,15 +209,14 @@ nvlist_print_with_indent(FILE *fp, nvlis
 			int64_t *val;
 			(void) nvpair_value_int64_array(nvp, val, nelem);
 			for (i = 0; i  nelem; i++)
-(void) fprintf(fp,  %lld, (longlong_t)val[i]);
+(void) fprintf(fp,  % PRId64, val[i]);
 			break;
 		}
 		case DATA_TYPE_UINT64_ARRAY: {
 			uint64_t *val;
 			(void) nvpair_value_uint64_array(nvp, val, nelem);
 			for (i = 0; i  nelem; i++)
-(void) fprintf(fp,  0x%llx,
-(u_longlong_t)val[i]);
+(void) fprintf(fp,  0x% PRIx64, val[i]);
 			break;
 		}
 		case DATA_TYPE_STRING_ARRAY: {
@@ -230,7 +229,7 @@ nvlist_print_with_indent(FILE *fp, nvlis
 		case DATA_TYPE_HRTIME: {
 			hrtime_t val;
 			(void) nvpair_value_hrtime(nvp, val);
-			(void) fprintf(fp,  0x%llx, val);
+			(void) fprintf(fp,  0x%jx, (intmax_t)val);
 			break;
 		}
 		case DATA_TYPE_NVLIST: {
@@ -344,11 +343,11 @@ dump_nvlist(nvlist_t *list, int indent)
 			break;
 
 		case DATA_TYPE_INT64:
-			NVP(elem, int64, int64_t, longlong_t, %lld);
+			NVP(elem, int64, int64_t, int64_t, % PRIx64);
 			break;
 
 		case DATA_TYPE_UINT64:
-			NVP(elem, uint64, uint64_t, u_longlong_t, %llu);
+			NVP(elem, uint64, uint64_t, uint64_t, % PRIu64);
 			break;
 
 		case DATA_TYPE_STRING:
@@ -384,12 +383,12 @@ dump_nvlist(nvlist_t *list, int indent)
 			break;
 
 		case DATA_TYPE_INT64_ARRAY:
-			NVPA(elem, int64_array, int64_t, longlong_t, %lld);
+			NVPA(elem, int64_array, int64_t, int64_t, % PRId64);
 			break;
 
 		case DATA_TYPE_UINT64_ARRAY:
-			NVPA(elem, uint64_array, uint64_t, u_longlong_t,
-			%llu);
+			NVPA(elem, uint64_array, uint64_t, uint64_t,
+			% PRIu64);
 			break;
 
 		case DATA_TYPE_STRING_ARRAY:



CVS commit: src/sbin/mount_lfs

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 19 23:14:27 UTC 2013

Modified Files:
src/sbin/mount_lfs: mount_lfs.c

Log Message:
put back oldflags and __USE it.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sbin/mount_lfs/mount_lfs.c

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

Modified files:

Index: src/sbin/mount_lfs/mount_lfs.c
diff -u src/sbin/mount_lfs/mount_lfs.c:1.36 src/sbin/mount_lfs/mount_lfs.c:1.37
--- src/sbin/mount_lfs/mount_lfs.c:1.36	Sat Oct 19 13:04:41 2013
+++ src/sbin/mount_lfs/mount_lfs.c	Sat Oct 19 19:14:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_lfs.c,v 1.36 2013/10/19 17:04:41 christos Exp $	*/
+/*	$NetBSD: mount_lfs.c,v 1.37 2013/10/19 23:14:27 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1993, 19
 #if 0
 static char sccsid[] = @(#)mount_lfs.c	8.4 (Berkeley) 4/26/95;
 #else
-__RCSID($NetBSD: mount_lfs.c,v 1.36 2013/10/19 17:04:41 christos Exp $);
+__RCSID($NetBSD: mount_lfs.c,v 1.37 2013/10/19 23:14:27 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -151,7 +151,7 @@ mount_lfs(int argc, char *argv[])
 {
 	struct ufs_args args;
 	int mntflags;
-	int mntsize, i;
+	int mntsize, oldflags, i;
 	char fs_name[MAXPATHLEN], canon_dev[MAXPATHLEN];
 	struct statvfs *mntbuf;
 	const char *errcause;
@@ -163,11 +163,13 @@ mount_lfs(int argc, char *argv[])
 	 * performing the mount, so we can know whether to start or
 	 * kill the cleaner process below.
 	 */
+	oldflags = MNT_RDONLY; /* If not mounted, pretend r/o */
 	if (mntflags  MNT_UPDATE) {
 		if ((mntsize = getmntinfo(mntbuf, MNT_NOWAIT)) == 0)
 			err(1, getmntinfo);
 		for (i = 0; i  mntsize; i++) {
 			if (strcmp(mntbuf[i].f_mntfromname, args.fspec) == 0) {
+oldflags = mntbuf[i].f_flag;
 break;
 			}
 		}
@@ -204,6 +206,8 @@ mount_lfs(int argc, char *argv[])
 	/* Downgrade to r/o; kill the cleaner */
 	if ((mntflags  MNT_RDONLY)  !(oldflags  MNT_RDONLY))
 		kill_cleaner(fs_name);
+#else
+	__USE(oldflags);
 #endif /* WANT_CLEANER */
 
 	exit(0);



CVS commit: src/lib/libc/net

2013-10-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Oct 19 23:34:48 UTC 2013

Modified Files:
src/lib/libc/net: inet6_getscopeid.3

Log Message:
Minor fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/net/inet6_getscopeid.3

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

Modified files:

Index: src/lib/libc/net/inet6_getscopeid.3
diff -u src/lib/libc/net/inet6_getscopeid.3:1.1 src/lib/libc/net/inet6_getscopeid.3:1.2
--- src/lib/libc/net/inet6_getscopeid.3:1.1	Sat Oct 19 19:56:56 2013
+++ src/lib/libc/net/inet6_getscopeid.3	Sat Oct 19 23:34:48 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: inet6_getscopeid.3,v 1.1 2013/10/19 19:56:56 christos Exp $
+.\	$NetBSD: inet6_getscopeid.3,v 1.2 2013/10/19 23:34:48 wiz Exp $
 .\-
 .\ Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -34,7 +34,7 @@
 .\
 .Sh NAME
 .Nm inet6_getscopeid ,
-.Nm inet6_putscopeid 
+.Nm inet6_putscopeid
 .Nd IPv6 scope id encoding and decoding functions
 .\
 .Sh SYNOPSIS
@@ -67,11 +67,12 @@ function stores the scope id found in
 .Ft sin6_scope_id
 into the 3rd and 4th byte of the address.
 It then clears the
-.Ft sin6_scope_id
+.Ft sin6_scope_id .
 .Pp
 The
 .Fa flags
-argument controls for which addresses this action is performed. It
+argument controls for which addresses this action is performed.
+It
 can be a combination of:
 .Bl -tag -width INET6_IS_ADDR_MC_LINKLOCAL
 .It Dv INET6_IS_ADDR_LINKLOCAL
@@ -80,4 +81,4 @@ can be a combination of:
 .El
 .Sh HISTORY
 These functions first appeared in
-.Nx 7 .
+.Nx 7.0 .



CVS commit: src/sys/ufs/ffs

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 00:00:51 UTC 2013

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

Log Message:
always declare needswap


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/ufs/ffs/ffs_alloc.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_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.141 src/sys/ufs/ffs/ffs_alloc.c:1.142
--- src/sys/ufs/ffs/ffs_alloc.c:1.141	Sat Oct 19 15:20:50 2013
+++ src/sys/ufs/ffs/ffs_alloc.c	Sat Oct 19 20:00:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.141 2013/10/19 19:20:50 martin Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.142 2013/10/20 00:00:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_alloc.c,v 1.141 2013/10/19 19:20:50 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_alloc.c,v 1.142 2013/10/20 00:00:51 christos Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -1092,9 +1092,7 @@ ffs_alloccg(struct inode *ip, int cg, da
 	daddr_t blkno;
 	int error, frags, allocsiz, i;
 	u_int8_t *blksfree;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	ump = ip-i_ump;
 



CVS commit: src/sys/fs/msdosfs

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 00:01:55 UTC 2013

Modified Files:
src/sys/fs/msdosfs: direntry.h

Log Message:
provide a function to access the name and extension as a single array as
opposed depend on array index overflow.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/fs/msdosfs/direntry.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/fs/msdosfs/direntry.h
diff -u src/sys/fs/msdosfs/direntry.h:1.6 src/sys/fs/msdosfs/direntry.h:1.7
--- src/sys/fs/msdosfs/direntry.h:1.6	Fri Jan 25 19:21:49 2013
+++ src/sys/fs/msdosfs/direntry.h	Sat Oct 19 20:01:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: direntry.h,v 1.6 2013/01/26 00:21:49 christos Exp $	*/
+/*	$NetBSD: direntry.h,v 1.7 2013/10/20 00:01:55 christos Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -78,6 +78,12 @@ struct direntry {
 	u_int8_t	deFileSize[4];	/* size of file in bytes */
 };
 
+static __inline uint8_t
+msdos_dirchar(const struct direntry *de, size_t i) {
+	return i  sizeof(de-deName) ? de-deName[i] :
+	de-deExtension[i - sizeof(de-deName)];
+}
+
 /*
  * Structure of a Win95 long name directory entry
  */



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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 00:16:16 UTC 2013

Modified Files:
src/sys/arch/i386/stand/pxeboot: pxe_call.S

Log Message:
Move an instruction above .code16 so that it produces an R_386_32 instead
of an R_386_16 relocation, which is truncated to fit. XXX: untested.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/pxeboot/pxe_call.S

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/pxeboot/pxe_call.S
diff -u src/sys/arch/i386/stand/pxeboot/pxe_call.S:1.3 src/sys/arch/i386/stand/pxeboot/pxe_call.S:1.4
--- src/sys/arch/i386/stand/pxeboot/pxe_call.S:1.3	Sat Feb  1 09:48:19 2003
+++ src/sys/arch/i386/stand/pxeboot/pxe_call.S	Sat Oct 19 20:16:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxe_call.S,v 1.3 2003/02/01 14:48:19 dsl Exp $	*/
+/*	$NetBSD: pxe_call.S,v 1.4 2013/10/20 00:16:16 christos Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -88,10 +88,10 @@ ENTRY(pxecall_pxenv)
 	movl	8(%ebp), %ebx
 
 	call	_C_LABEL(prot_to_real)		# enter real mode
+	/* prot_to_real() has already set %es to BOOTSEG */
+	lea	_C_LABEL(pxe_command_buf), %edi
 	.code16
 
-	/* prot_to_real() has already set %es to BOOTSEG */
-	lea	_C_LABEL(pxe_command_buf), %di
 
 	/* The encoding is: 0x9a offlo offhi seglo seghi */
 	lcall	$0, $0x



CVS commit: src/sys/ufs/ffs

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 00:20:53 UTC 2013

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

Log Message:
always declare needswap


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/ufs/ffs/ffs_alloc.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_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.142 src/sys/ufs/ffs/ffs_alloc.c:1.143
--- src/sys/ufs/ffs/ffs_alloc.c:1.142	Sat Oct 19 20:00:51 2013
+++ src/sys/ufs/ffs/ffs_alloc.c	Sat Oct 19 20:20:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.142 2013/10/20 00:00:51 christos Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.143 2013/10/20 00:20:53 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_alloc.c,v 1.142 2013/10/20 00:00:51 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_alloc.c,v 1.143 2013/10/20 00:20:53 christos Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -1206,9 +1206,7 @@ ffs_alloccgblk(struct inode *ip, struct 
 	daddr_t blkno;
 	int32_t bno;
 	u_int8_t *blksfree;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	KASSERT(mutex_owned(ip-i_ump-um_lock));
 
@@ -1285,9 +1283,7 @@ ffs_nodealloccg(struct inode *ip, int cg
 	int32_t initediblk;
 	daddr_t nalloc;
 	struct ufs2_dinode *dp2;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	KASSERT(mutex_owned(ump-um_lock));
 	UFS_WAPBL_JLOCK_ASSERT(ip-i_ump-um_mountp);
@@ -1557,9 +1553,7 @@ ffs_blkfree_cg(struct fs *fs, struct vno
 	int error, cg;
 	dev_t dev;
 	const bool devvp_is_snapshot = (devvp-v_type != VBLK);
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	KASSERT(!devvp_is_snapshot);
 
@@ -1829,9 +1823,7 @@ ffs_blkfree_snap(struct fs *fs, struct v
 	int error, cg;
 	dev_t dev;
 	const bool devvp_is_snapshot = (devvp-v_type != VBLK);
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	KASSERT(devvp_is_snapshot);
 
@@ -1992,9 +1984,7 @@ ffs_freefile(struct mount *mp, ino_t ino
 	int error, cg;
 	daddr_t cgbno;
 	dev_t dev;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	cg = ino_to_cg(fs, ino);
 	devvp = ump-um_devvp;
@@ -2031,9 +2021,7 @@ ffs_freefile_snap(struct fs *fs, struct 
 	int error, cg;
 	daddr_t cgbno;
 	dev_t dev;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	KASSERT(devvp-v_type != VBLK);
 
@@ -2069,9 +2057,7 @@ ffs_freefile_common(struct ufsmount *ump
 	int cg;
 	struct cg *cgp;
 	u_int8_t *inosused;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	cg = ino_to_cg(fs, ino);
 	cgp = (struct cg *)bp-b_data;
@@ -2159,9 +2145,7 @@ ffs_mapsearch(struct fs *fs, struct cg *
 	int blk, field, subfield, pos;
 	int ostart, olen;
 	u_int8_t *blksfree;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	/* KASSERT(mutex_owned(ump-um_lock)); */
 



CVS commit: src/sys/ufs

2013-10-19 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Sun Oct 20 00:29:10 UTC 2013

Modified Files:
src/sys/ufs/ffs: ffs_balloc.c ffs_inode.c ffs_subr.c ffs_wapbl.c
src/sys/ufs/ufs: ufs_lookup.c ufs_quota2.c

Log Message:
Definining needswap where needed.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/ufs/ffs/ffs_balloc.c
cvs rdiff -u -r1.115 -r1.116 src/sys/ufs/ffs/ffs_inode.c
cvs rdiff -u -r1.47 -r1.48 src/sys/ufs/ffs/ffs_subr.c
cvs rdiff -u -r1.23 -r1.24 src/sys/ufs/ffs/ffs_wapbl.c
cvs rdiff -u -r1.125 -r1.126 src/sys/ufs/ufs/ufs_lookup.c
cvs rdiff -u -r1.35 -r1.36 src/sys/ufs/ufs/ufs_quota2.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_balloc.c
diff -u src/sys/ufs/ffs/ffs_balloc.c:1.59 src/sys/ufs/ffs/ffs_balloc.c:1.60
--- src/sys/ufs/ffs/ffs_balloc.c:1.59	Sun Jun 23 07:28:37 2013
+++ src/sys/ufs/ffs/ffs_balloc.c	Sun Oct 20 00:29:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_balloc.c,v 1.59 2013/06/23 07:28:37 dholland Exp $	*/
+/*	$NetBSD: ffs_balloc.c,v 1.60 2013/10/20 00:29:10 htodd Exp $	*/
 
 /*
  * Copyright (c) 2002 Networks Associates Technology, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_balloc.c,v 1.59 2013/06/23 07:28:37 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_balloc.c,v 1.60 2013/10/20 00:29:10 htodd Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_quota.h
@@ -111,9 +111,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t 
 	int32_t *blkp, *allocblk, allociblk[UFS_NIADDR + 1];
 	int32_t *allocib;
 	int unwindidx = -1;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 	UVMHIST_FUNC(ffs_balloc); UVMHIST_CALLED(ubchist);
 
 	lbn = ffs_lblkno(fs, off);
@@ -528,9 +526,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t 
 	daddr_t *blkp, *allocblk, allociblk[UFS_NIADDR + 1];
 	int64_t *allocib;
 	int unwindidx = -1;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 	UVMHIST_FUNC(ffs_balloc); UVMHIST_CALLED(ubchist);
 
 	lbn = ffs_lblkno(fs, off);

Index: src/sys/ufs/ffs/ffs_inode.c
diff -u src/sys/ufs/ffs/ffs_inode.c:1.115 src/sys/ufs/ffs/ffs_inode.c:1.116
--- src/sys/ufs/ffs/ffs_inode.c:1.115	Sun Jun 23 07:28:37 2013
+++ src/sys/ufs/ffs/ffs_inode.c	Sun Oct 20 00:29:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_inode.c,v 1.115 2013/06/23 07:28:37 dholland Exp $	*/
+/*	$NetBSD: ffs_inode.c,v 1.116 2013/10/20 00:29:10 htodd Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_inode.c,v 1.115 2013/06/23 07:28:37 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_inode.c,v 1.116 2013/10/20 00:29:10 htodd Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -555,9 +555,7 @@ ffs_indirtrunc(struct inode *ip, daddr_t
 	int64_t blkcount, factor, blocksreleased = 0;
 	int nblocks;
 	int error = 0, allerror = 0;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 #define RBAP(ip, i) (((ip)-i_ump-um_fstype == UFS1) ? \
 	ufs_rw32(bap1[i], needswap) : ufs_rw64(bap2[i], needswap))
 #define BAP_ASSIGN(ip, i, value)	\

Index: src/sys/ufs/ffs/ffs_subr.c
diff -u src/sys/ufs/ffs/ffs_subr.c:1.47 src/sys/ufs/ffs/ffs_subr.c:1.48
--- src/sys/ufs/ffs/ffs_subr.c:1.47	Sun Aug 14 12:37:09 2011
+++ src/sys/ufs/ffs/ffs_subr.c	Sun Oct 20 00:29:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_subr.c,v 1.47 2011/08/14 12:37:09 christos Exp $	*/
+/*	$NetBSD: ffs_subr.c,v 1.48 2013/10/20 00:29:10 htodd Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -36,7 +36,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_subr.c,v 1.47 2011/08/14 12:37:09 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_subr.c,v 1.48 2013/10/20 00:29:10 htodd Exp $);
 
 #include sys/param.h
 
@@ -286,9 +286,7 @@ ffs_clusteracct(struct fs *fs, struct cg
 	int32_t *lp;
 	u_char *freemapp, *mapp;
 	int i, start, end, forw, back, map, bit;
-#ifdef FFS_EI
 	const int needswap = UFS_FSNEEDSWAP(fs);
-#endif
 
 	/* KASSERT(mutex_owned(ump-um_lock)); */
 

Index: src/sys/ufs/ffs/ffs_wapbl.c
diff -u src/sys/ufs/ffs/ffs_wapbl.c:1.23 src/sys/ufs/ffs/ffs_wapbl.c:1.24
--- src/sys/ufs/ffs/ffs_wapbl.c:1.23	Sat Oct 19 19:29:59 2013
+++ src/sys/ufs/ffs/ffs_wapbl.c	Sun Oct 20 00:29:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_wapbl.c,v 1.23 2013/10/19 19:29:59 martin Exp $	*/
+/*	$NetBSD: ffs_wapbl.c,v 1.24 2013/10/20 00:29:10 htodd Exp $	*/
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_wapbl.c,v 1.23 2013/10/19 19:29:59 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_wapbl.c,v 1.24 2013/10/20 00:29:10 htodd Exp $);
 
 #define WAPBL_INTERNAL
 
@@ -731,9 +731,7 @@ wapbl_find_log_start(struct mount *mp, s
 	daddr_t desired_blks, min_desired_blks;
 	daddr_t freeblks, best_blks;
 	int bpcg, cg, error, fixedsize, indir_blks, n, s;

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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 02:47:38 UTC 2013

Modified Files:
src/external/bsd/ntp/dist/libntp: icom.c
src/external/bsd/ntp/dist/ntpd: ntp_crypto.c ntp_proto.c
refclock_acts.c refclock_chu.c refclock_irig.c refclock_oncore.c
src/external/bsd/ntp/dist/sntp: main.c

Log Message:
fix unused variable warnings


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/libntp/icom.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpd/ntp_crypto.c \
src/external/bsd/ntp/dist/ntpd/refclock_acts.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/ntp_proto.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/ntp/dist/ntpd/refclock_chu.c \
src/external/bsd/ntp/dist/ntpd/refclock_irig.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/refclock_oncore.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/sntp/main.c

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

Modified files:

Index: src/external/bsd/ntp/dist/libntp/icom.c
diff -u src/external/bsd/ntp/dist/libntp/icom.c:1.3 src/external/bsd/ntp/dist/libntp/icom.c:1.4
--- src/external/bsd/ntp/dist/libntp/icom.c:1.3	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/libntp/icom.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: icom.c,v 1.3 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: icom.c,v 1.4 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * Program to control ICOM radios
@@ -129,11 +129,9 @@ icom_init(
 {
 	TTY ttyb;
 	int fd;
-	int flags;
 	int rc;
 	int saved_errno;
 
-	flags = trace;
 	fd = tty_open(device, O_RDWR, 0777);
 	if (fd  0)
 		return -1;

Index: src/external/bsd/ntp/dist/ntpd/ntp_crypto.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.4 src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.5
--- src/external/bsd/ntp/dist/ntpd/ntp_crypto.c:1.4	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_crypto.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_crypto.c,v 1.4 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: ntp_crypto.c,v 1.5 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * ntp_crypto.c - NTP version 4 public key routines
@@ -393,7 +393,6 @@ crypto_recv(
 	int	has_mac;	/* length of MAC field */
 	int	authlen;	/* offset of MAC field */
 	associd_t associd;	/* association ID */
-	tstamp_t tstamp = 0;	/* timestamp */
 	tstamp_t fstamp = 0;	/* filestamp */
 	u_int	len;		/* extension field length */
 	u_int	code;		/* extension field opcode */
@@ -443,7 +442,6 @@ crypto_recv(
 		}
 
 		if (len = VALUE_LEN) {
-			tstamp = ntohl(ep-tstamp);
 			fstamp = ntohl(ep-fstamp);
 			vallen = ntohl(ep-vallen);
 		}
Index: src/external/bsd/ntp/dist/ntpd/refclock_acts.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.4 src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.5
--- src/external/bsd/ntp/dist/ntpd/refclock_acts.c:1.4	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_acts.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_acts.c,v 1.4 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: refclock_acts.c,v 1.5 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * refclock_acts - clock driver for the NIST/USNO/PTB/NPL Computer Time
@@ -638,7 +638,6 @@ acts_poll (
 	struct peer *peer
 	)
 {
-	struct actsunit *up;
 	struct refclockproc *pp;
 
 	/*
@@ -647,7 +646,6 @@ acts_poll (
 	 * the timeout routine and state machine.
 	 */
 	pp = peer-procptr;
-	up = (struct actsunit *)pp-unitptr;
 	switch (peer-ttl) {
 
 	/*

Index: src/external/bsd/ntp/dist/ntpd/ntp_proto.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_proto.c:1.3 src/external/bsd/ntp/dist/ntpd/ntp_proto.c:1.4
--- src/external/bsd/ntp/dist/ntpd/ntp_proto.c:1.3	Wed Feb  1 02:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_proto.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_proto.c,v 1.3 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: ntp_proto.c,v 1.4 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * ntp_proto.c - NTP version 4 protocol machinery
@@ -2220,7 +2220,7 @@ clock_select(void)
 	struct peer *peer;
 	int	i, j, k, n;
 	int	nlist, nl3;
-	int	allow, osurv;
+	int	allow;
 	double	d, e, f, g;
 	double	high, low;
 	double	seljitter;
@@ -2249,7 +2249,6 @@ clock_select(void)
 	 * enough to handle all associations.
 	 */
 	osys_peer = sys_peer;
-	osurv = sys_survivors;
 	sys_survivors = 0;
 #ifdef LOCKCLOCK
 	sys_leap = LEAP_NOTINSYNC;

Index: src/external/bsd/ntp/dist/ntpd/refclock_chu.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_chu.c:1.1.1.2 src/external/bsd/ntp/dist/ntpd/refclock_chu.c:1.2
--- src/external/bsd/ntp/dist/ntpd/refclock_chu.c:1.1.1.2	Tue Jan 31 16:25:55 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_chu.c	Sat Oct 19 22:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_chu.c,v 1.1.1.2 2012/01/31 21:25:55 kardel Exp $	*/
+/*	$NetBSD: refclock_chu.c,v 1.2 2013/10/20 02:47:38 christos Exp $	*/
 
 /*
  * refclock_chu - 

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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 02:58:24 UTC 2013

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

Log Message:
fix type punned issue


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

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

Modified files:

Index: src/external/bsd/tcpdump/dist/addrtoname.c
diff -u src/external/bsd/tcpdump/dist/addrtoname.c:1.3 src/external/bsd/tcpdump/dist/addrtoname.c:1.4
--- src/external/bsd/tcpdump/dist/addrtoname.c:1.3	Sat Apr  6 15:33:07 2013
+++ src/external/bsd/tcpdump/dist/addrtoname.c	Sat Oct 19 22:58:24 2013
@@ -27,7 +27,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.119 2007-08-08 14:06:34 hannes Exp  (LBL);
 #endif
-__RCSID($NetBSD: addrtoname.c,v 1.3 2013/04/06 19:33:07 christos Exp $);
+__RCSID($NetBSD: addrtoname.c,v 1.4 2013/10/20 02:58:24 christos Exp $);
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -281,9 +281,11 @@ getname6(const u_char *ap)
 	static struct h6namemem *p;		/* static for longjmp() */
 	register const char *cp;
 	char ntop_buf[INET6_ADDRSTRLEN];
+	uint16_t h;
 
 	memcpy(addr, ap, sizeof(addr));
-	p = h6nametable[*(u_int16_t *)addr.s6_addr[14]  (HASHNAMESIZE-1)];
+	memcpy(h, addr.s6_addr[14], sizeof(h));
+	p = h6nametable[h  (HASHNAMESIZE-1)];
 	for (; p-nxt; p = p-nxt) {
 		if (memcmp(p-addr, addr, sizeof(addr)) == 0)
 			return (p-name);



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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 02:58:34 UTC 2013

Modified Files:
src/external/bsd/tcpdump/dist: print-esp.c print-icmp6.c print-isakmp.c
print-pgm.c print-pim.c print-sctp.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tcpdump/dist/print-esp.c \
src/external/bsd/tcpdump/dist/print-pgm.c \
src/external/bsd/tcpdump/dist/print-pim.c \
src/external/bsd/tcpdump/dist/print-sctp.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tcpdump/dist/print-icmp6.c \
src/external/bsd/tcpdump/dist/print-isakmp.c

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

Modified files:

Index: src/external/bsd/tcpdump/dist/print-esp.c
diff -u src/external/bsd/tcpdump/dist/print-esp.c:1.3 src/external/bsd/tcpdump/dist/print-esp.c:1.4
--- src/external/bsd/tcpdump/dist/print-esp.c:1.3	Sat Apr  6 15:33:08 2013
+++ src/external/bsd/tcpdump/dist/print-esp.c	Sat Oct 19 22:58:34 2013
@@ -27,7 +27,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/print-esp.c,v 1.58 2007-12-07 00:03:07 mcr Exp  (LBL);
 #else
-__RCSID($NetBSD: print-esp.c,v 1.3 2013/04/06 19:33:08 christos Exp $);
+__RCSID($NetBSD: print-esp.c,v 1.4 2013/10/20 02:58:34 christos Exp $);
 #endif
 #endif
 
@@ -221,7 +221,6 @@ static int
 espprint_decode_encalgo(netdissect_options *ndo,
 			char *decode, struct sa_list *sa)
 {
-	int len;
 	size_t i;
 	const EVP_CIPHER *evp;
 	int authlen = 0;
@@ -234,7 +233,6 @@ espprint_decode_encalgo(netdissect_optio
 	}
 	*colon = '\0';
 	
-	len = colon - decode;
 	if (strlen(decode)  strlen(-hmac96) 
 	!strcmp(decode + strlen(decode) - strlen(-hmac96),
 		-hmac96)) {
@@ -540,7 +538,6 @@ esp_print(netdissect_options *ndo,
 #ifdef HAVE_LIBCRYPTO
 	struct ip *ip;
 	struct sa_list *sa = NULL;
-	int espsecret_keylen;
 #ifdef INET6
 	struct ip6_hdr *ip6 = NULL;
 #endif
@@ -551,7 +548,6 @@ esp_print(netdissect_options *ndo,
 	u_char *ivoff;
 	u_char *p;
 	EVP_CIPHER_CTX ctx;
-	int blocksz;
 #endif
 
 	esp = (struct newesp *)bp;
@@ -655,7 +651,6 @@ esp_print(netdissect_options *ndo,
 	ivoff = (u_char *)(esp + 1) + 0;
 	ivlen = sa-ivlen;
 	secret = sa-secret;
-	espsecret_keylen = sa-secretlen;
 	ep = ep - sa-authlen;
 
 	if (sa-evp) {
@@ -663,7 +658,7 @@ esp_print(netdissect_options *ndo,
 		if (EVP_CipherInit(ctx, sa-evp, secret, NULL, 0)  0)
 			(*ndo-ndo_warning)(ndo, espkey init failed);
 
-		blocksz = EVP_CIPHER_CTX_block_size(ctx);
+		(void)EVP_CIPHER_CTX_block_size(ctx);
 
 		p = ivoff;
 		EVP_CipherInit(ctx, NULL, NULL, p, 0);
Index: src/external/bsd/tcpdump/dist/print-pgm.c
diff -u src/external/bsd/tcpdump/dist/print-pgm.c:1.3 src/external/bsd/tcpdump/dist/print-pgm.c:1.4
--- src/external/bsd/tcpdump/dist/print-pgm.c:1.3	Sat Apr  6 15:33:08 2013
+++ src/external/bsd/tcpdump/dist/print-pgm.c	Sat Oct 19 22:58:34 2013
@@ -19,7 +19,7 @@
 static const char rcsid[] _U_ =
 @(#) Header: /tcpdump/master/tcpdump/print-pgm.c,v 1.5 2005-06-07 22:05:58 guy Exp ;
 #else
-__RCSID($NetBSD: print-pgm.c,v 1.3 2013/04/06 19:33:08 christos Exp $);
+__RCSID($NetBSD: print-pgm.c,v 1.4 2013/10/20 02:58:34 christos Exp $);
 #endif
 #endif
 
@@ -176,7 +176,7 @@ pgm_print(register const u_char *bp, reg
 #else
 	char nla_buf[INET_ADDRSTRLEN];
 #endif
-	u_int8_t opt_type, opt_len, flags1, flags2;
+	u_int8_t opt_type, opt_len;
 	u_int32_t seq, opts_len, len, offset;
 
 	pgm = (struct pgm_header *)bp;
@@ -550,8 +550,7 @@ pgm_print(register const u_char *bp, reg
 			(void)printf([Bad OPT_FRAGMENT option, length %u != 16], opt_len);
 			return;
 		}
-		flags1 = *bp++;
-		flags2 = *bp++;
+		bp += 2;	/* skip flags */
 		seq = EXTRACT_32BITS(bp);
 		bp += sizeof(u_int32_t);
 		offset = EXTRACT_32BITS(bp);
@@ -563,8 +562,7 @@ pgm_print(register const u_char *bp, reg
 		break;
 
 		case PGM_OPT_NAK_LIST:
-		flags1 = *bp++;
-		flags2 = *bp++;
+		bp += 2;	/* skip flags */
 		opt_len -= sizeof(u_int32_t);	/* option header */
 		(void)printf( NAK LIST);
 		while (opt_len) {
@@ -585,8 +583,7 @@ pgm_print(register const u_char *bp, reg
 			(void)printf([Bad OPT_JOIN option, length %u != 8], opt_len);
 			return;
 		}
-		flags1 = *bp++;
-		flags2 = *bp++;
+		bp += 2;	/* skip flags */
 		seq = EXTRACT_32BITS(bp);
 		bp += sizeof(u_int32_t);
 		(void)printf( JOIN %u, seq);
@@ -598,8 +595,7 @@ pgm_print(register const u_char *bp, reg
 			(void)printf([Bad OPT_NAK_BO_IVL option, length %u != 12], opt_len);
 			return;
 		}
-		flags1 = *bp++;
-		flags2 = *bp++;
+		bp += 2;	/* skip flags */
 		offset = EXTRACT_32BITS(bp);
 		bp += sizeof(u_int32_t);
 		seq = EXTRACT_32BITS(bp);
@@ -613,8 +609,7 @@ pgm_print(register const u_char *bp, reg
 			(void)printf([Bad OPT_NAK_BO_RNG option, length %u != 12], opt_len);
 			return;
 		}
-		

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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:00:02 UTC 2013

Modified Files:
src/external/bsd/tmux/dist: cmd-if-shell.c

Log Message:
remove unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/tmux/dist/cmd-if-shell.c

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

Modified files:

Index: src/external/bsd/tmux/dist/cmd-if-shell.c
diff -u src/external/bsd/tmux/dist/cmd-if-shell.c:1.1.1.2 src/external/bsd/tmux/dist/cmd-if-shell.c:1.2
--- src/external/bsd/tmux/dist/cmd-if-shell.c:1.1.1.2	Wed Aug 17 14:40:04 2011
+++ src/external/bsd/tmux/dist/cmd-if-shell.c	Sat Oct 19 23:00:02 2013
@@ -1,4 +1,4 @@
-/* $Id: cmd-if-shell.c,v 1.1.1.2 2011/08/17 18:40:04 jmmv Exp $ */
+/* $Id: cmd-if-shell.c,v 1.2 2013/10/20 03:00:02 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Tiago Cunha m...@tiagocunha.org
@@ -97,11 +97,9 @@ cmd_if_shell_free(void *data)
 {
 	struct cmd_if_shell_data	*cdata = data;
 	struct cmd_ctx			*ctx = cdata-ctx;
-	struct msg_exit_data		 exitdata;
 
 	if (ctx-cmdclient != NULL) {
 		ctx-cmdclient-references--;
-		exitdata.retcode = ctx-cmdclient-retcode;
 		ctx-cmdclient-flags |= CLIENT_EXIT;
 	}
 	if (ctx-curclient != NULL)



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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:02:27 UTC 2013

Modified Files:
src/external/bsd/top/dist: hash.c
src/external/bsd/top/dist/machine: m_netbsd.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/top/dist/hash.c
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/top/dist/machine/m_netbsd.c

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

Modified files:

Index: src/external/bsd/top/dist/hash.c
diff -u src/external/bsd/top/dist/hash.c:1.3 src/external/bsd/top/dist/hash.c:1.4
--- src/external/bsd/top/dist/hash.c:1.3	Tue May  5 14:51:21 2009
+++ src/external/bsd/top/dist/hash.c	Sat Oct 19 23:02:26 2013
@@ -579,7 +579,6 @@ hash_remove_pos_uint(hash_pos *pos)
 llistitem *li;
 void *ans;
 hash_item_uint *hi;
-unsigned int key;
 
 /* sanity checks */
 if (pos == NULL || pos-ll_last == pos-ll_item)
@@ -597,9 +596,6 @@ hash_remove_pos_uint(hash_pos *pos)
 hi = (hash_item_uint *)li-datum;
 ans = hi-value;
 
-/* free up the space */
-key = hi-key;
-;
 ll_freeitem(li);
 
 /* back up to previous item */
@@ -917,7 +913,6 @@ hash_remove_pos_pid(hash_pos *pos)
 llistitem *li;
 void *ans;
 hash_item_pid *hi;
-pid_t key;
 
 /* sanity checks */
 if (pos == NULL || pos-ll_last == pos-ll_item)
@@ -936,8 +931,6 @@ hash_remove_pos_pid(hash_pos *pos)
 ans = hi-value;
 
 /* free up the space */
-key = hi-key;
-;
 ll_freeitem(li);
 
 /* back up to previous item */
@@ -1593,7 +1586,6 @@ hash_remove_pos_pidthr(hash_pos *pos)
 llistitem *li;
 void *ans;
 hash_item_pidthr *hi;
-pidthr_t key;
 
 /* sanity checks */
 if (pos == NULL || pos-ll_last == pos-ll_item)
@@ -1612,8 +1604,6 @@ hash_remove_pos_pidthr(hash_pos *pos)
 ans = hi-value;
 
 /* free up the space */
-key = hi-key;
-;
 ll_freeitem(li);
 
 /* back up to previous item */
@@ -1932,7 +1922,6 @@ hash_remove_pos_lwpid(hash_pos *pos)
 llistitem *li;
 void *ans;
 hash_item_lwpid *hi;
-lwpid_t key;
 
 /* sanity checks */
 if (pos == NULL || pos-ll_last == pos-ll_item)
@@ -1951,8 +1940,6 @@ hash_remove_pos_lwpid(hash_pos *pos)
 ans = hi-value;
 
 /* free up the space */
-key = hi-key;
-;
 ll_freeitem(li);
 
 /* back up to previous item */

Index: src/external/bsd/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.17 src/external/bsd/top/dist/machine/m_netbsd.c:1.18
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.17	Thu Jan  3 05:12:36 2013
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Sat Oct 19 23:02:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.17 2013/01/03 10:12:36 para Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.18 2013/10/20 03:02:27 christos Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *		Andrew Doran a...@netbsd.org
  *
  *
- * $Id: m_netbsd.c,v 1.17 2013/01/03 10:12:36 para Exp $
+ * $Id: m_netbsd.c,v 1.18 2013/10/20 03:02:27 christos Exp $
  */
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: m_netbsd.c,v 1.17 2013/01/03 10:12:36 para Exp $);
+__RCSID($NetBSD: m_netbsd.c,v 1.18 2013/10/20 03:02:27 christos Exp $);
 #endif
 
 #include sys/param.h
@@ -587,7 +587,6 @@ get_proc_info(struct system_info *si, st
 	int show_idle;
 	int show_system;
 	int show_uid;
-	int show_command;
 
 	static struct handle handle;
 
@@ -627,7 +626,6 @@ get_proc_info(struct system_info *si, st
 	show_idle = sel-idle;
 	show_system = sel-system;
 	show_uid = sel-uid != -1;
-	show_command = sel-command != NULL;
 
 	/* count up process states and get pointers to interesting procs */
 	total_procs = 0;
@@ -687,7 +685,6 @@ get_lwp_info(struct system_info *si, str
 	int show_idle;
 	int show_system;
 	int show_uid;
-	int show_command;
 
 	static struct handle handle;
 
@@ -739,7 +736,6 @@ get_lwp_info(struct system_info *si, str
 	show_idle = sel-idle;
 	show_system = sel-system;
 	show_uid = sel-uid != -1;
-	show_command = sel-command != NULL;
 
 	/* count up thread states and get pointers to interesting threads */
 	total_lwps = 0;



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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:09:11 UTC 2013

Modified Files:
src/external/bsd/ipf/dist/lib: ipft_hx.c ipft_tx.c printfieldhdr.c
printfraginfo.c
src/external/bsd/ipf/dist/tools: ipfcomp.c ippool.c

Log Message:
fix unused variable warnings


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ipf/dist/lib/ipft_hx.c \
src/external/bsd/ipf/dist/lib/ipft_tx.c \
src/external/bsd/ipf/dist/lib/printfieldhdr.c \
src/external/bsd/ipf/dist/lib/printfraginfo.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ipf/dist/tools/ipfcomp.c \
src/external/bsd/ipf/dist/tools/ippool.c

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

Modified files:

Index: src/external/bsd/ipf/dist/lib/ipft_hx.c
diff -u src/external/bsd/ipf/dist/lib/ipft_hx.c:1.2 src/external/bsd/ipf/dist/lib/ipft_hx.c:1.3
--- src/external/bsd/ipf/dist/lib/ipft_hx.c:1.2	Sun Jul 22 10:27:36 2012
+++ src/external/bsd/ipf/dist/lib/ipft_hx.c	Sat Oct 19 23:09:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipft_hx.c,v 1.2 2012/07/22 14:27:36 darrenr Exp $	*/
+/*	$NetBSD: ipft_hx.c,v 1.3 2013/10/20 03:09:11 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -65,10 +65,8 @@ static	int	hex_readip(mb, ifn, dir)
 	char	line[513];
 	ip_t	*ip;
 	char	*buf;
-	int	cnt;
 
 	buf = (char *)mb-mb_buf;
-	cnt = sizeof(mb-mb_buf);
 	/*
 	 * interpret start of line as possibly [ifname] or
 	 * [in/out,ifname].
Index: src/external/bsd/ipf/dist/lib/ipft_tx.c
diff -u src/external/bsd/ipf/dist/lib/ipft_tx.c:1.2 src/external/bsd/ipf/dist/lib/ipft_tx.c:1.3
--- src/external/bsd/ipf/dist/lib/ipft_tx.c:1.2	Sun Jul 22 10:27:36 2012
+++ src/external/bsd/ipf/dist/lib/ipft_tx.c	Sat Oct 19 23:09:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipft_tx.c,v 1.2 2012/07/22 14:27:36 darrenr Exp $	*/
+/*	$NetBSD: ipft_tx.c,v 1.3 2013/10/20 03:09:11 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -122,10 +122,8 @@ static	int	text_readip(mb, ifn, dir)
 	char	line[513];
 	ip_t	*ip;
 	char	*buf;
-	int	cnt;
 
 	buf = (char *)mb-mb_buf;
-	cnt = sizeof(mb-mb_buf);
 
 	*ifn = NULL;
 	while (fgets(line, sizeof(line)-1, tfp)) {
Index: src/external/bsd/ipf/dist/lib/printfieldhdr.c
diff -u src/external/bsd/ipf/dist/lib/printfieldhdr.c:1.2 src/external/bsd/ipf/dist/lib/printfieldhdr.c:1.3
--- src/external/bsd/ipf/dist/lib/printfieldhdr.c:1.2	Sun Jul 22 10:27:36 2012
+++ src/external/bsd/ipf/dist/lib/printfieldhdr.c	Sat Oct 19 23:09:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: printfieldhdr.c,v 1.2 2012/07/22 14:27:36 darrenr Exp $	*/
+/*	$NetBSD: printfieldhdr.c,v 1.3 2013/10/20 03:09:11 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -18,10 +18,9 @@ printfieldhdr(words, field)
 {
 	wordtab_t *w;
 	char *s, *t;
-	int i;
 
 	if (field-w_value == -2) {
-		for (i = 0, w = words; w-w_word != NULL; ) {
+		for (w = words; w-w_word != NULL; ) {
 			if (w-w_value  0) {
 printfieldhdr(words, w);
 w++;
Index: src/external/bsd/ipf/dist/lib/printfraginfo.c
diff -u src/external/bsd/ipf/dist/lib/printfraginfo.c:1.2 src/external/bsd/ipf/dist/lib/printfraginfo.c:1.3
--- src/external/bsd/ipf/dist/lib/printfraginfo.c:1.2	Sun Jul 22 10:27:36 2012
+++ src/external/bsd/ipf/dist/lib/printfraginfo.c	Sat Oct 19 23:09:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: printfraginfo.c,v 1.2 2012/07/22 14:27:36 darrenr Exp $	*/
+/*	$NetBSD: printfraginfo.c,v 1.3 2013/10/20 03:09:11 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -16,7 +16,6 @@ printfraginfo(prefix, ifr)
 	char *prefix;
 	struct ipfr *ifr;
 {
-	frentry_t fr;
 	int family;
 
 	PRINTF(%s, prefix);
@@ -27,10 +26,11 @@ printfraginfo(prefix, ifr)
 		PRINTF(inet);
 		family = AF_INET;
 	}
-	fr.fr_flags = 0x;
 
 	PRINTF( %s - , hostname(family, ifr-ipfr_src));
 /*
+	frentry_t fr;
+	fr.fr_flags = 0x;
 	if (kmemcpy((char *)fr, (u_long)ifr-ipfr_rule,
 		sizeof(fr)) == -1)
 		return;

Index: src/external/bsd/ipf/dist/tools/ipfcomp.c
diff -u src/external/bsd/ipf/dist/tools/ipfcomp.c:1.3 src/external/bsd/ipf/dist/tools/ipfcomp.c:1.4
--- src/external/bsd/ipf/dist/tools/ipfcomp.c:1.3	Sun Jul 22 10:27:51 2012
+++ src/external/bsd/ipf/dist/tools/ipfcomp.c	Sat Oct 19 23:09:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipfcomp.c,v 1.3 2012/07/22 14:27:51 darrenr Exp $	*/
+/*	$NetBSD: ipfcomp.c,v 1.4 2013/10/20 03:09:11 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -65,7 +65,6 @@ static	FILE	*cfile = NULL;
 void printc(fr)
 	frentry_t *fr;
 {
-	fripf_t *ipf;
 	u_long *ulp;
 	char *and;
 	FILE *fp;
@@ -78,7 +77,6 @@ void printc(fr)
 	if ((fr-fr_type == FR_T_IPF) 
 	((fr-fr_datype != FRI_NORMAL) || (fr-fr_satype != FRI_NORMAL)))
 		return;
-	ipf = fr-fr_ipf;
 
 	if (cfile == NULL)
 		cfile = fopen(ip_rules.c, w);
Index: src/external/bsd/ipf/dist/tools/ippool.c
diff -u src/external/bsd/ipf/dist/tools/ippool.c:1.3 src/external/bsd/ipf/dist/tools/ippool.c:1.4
--- 

CVS commit: src/external/bsd/iscsi/dist/src/initiator

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:10:45 UTC 2013

Modified Files:
src/external/bsd/iscsi/dist/src/initiator: iscsi-initiator.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c

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

Modified files:

Index: src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c
diff -u src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.9 src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.10
--- src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c:1.9	Thu Oct  6 09:05:28 2011
+++ src/external/bsd/iscsi/dist/src/initiator/iscsi-initiator.c	Sat Oct 19 23:10:45 2013
@@ -542,7 +542,6 @@ main(int argc, char **argv)
 	char			name[1024];
 	char			*colon;
 	char		   *host;
-	char		   *user;
 	char			buf[32];
 	char			devtype;
 	int			discover;
@@ -552,7 +551,6 @@ main(int argc, char **argv)
 
 	(void) memset(tinfo, 0x0, sizeof(tinfo));
 	iscsi_initiator_set_defaults(ini);
-	user = NULL;
 	(void) gethostname(host = hostname, sizeof(hostname));
 	discover = 0;
 	(void) stat(/etc/hosts, sti.st);



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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:11:44 UTC 2013

Modified Files:
src/external/bsd/pdisk/dist: partition_map.c

Log Message:
remove unused variables


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

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

Modified files:

Index: src/external/bsd/pdisk/dist/partition_map.c
diff -u src/external/bsd/pdisk/dist/partition_map.c:1.2 src/external/bsd/pdisk/dist/partition_map.c:1.3
--- src/external/bsd/pdisk/dist/partition_map.c:1.2	Sat Mar 23 11:39:43 2013
+++ src/external/bsd/pdisk/dist/partition_map.c	Sat Oct 19 23:11:44 2013
@@ -317,13 +317,11 @@ read_partition_map(partition_map_header 
 void
 write_partition_map(partition_map_header *map)
 {
-MEDIA m;
 char *block;
 partition_map * entry;
 int i = 0;
 int result = 0;
 
-m = map-m;
 if (map-misc != NULL) {
 	convert_block0(map-misc, 0);
 	result = write_block(map, 0, (char *)map-misc);



CVS commit: src/external/bsd

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:14:34 UTC 2013

Modified Files:
src/external/bsd/bind/dist/lib/isc: sha2.c
src/external/bsd/dhcpcd/dist: if-bsd.c

Log Message:
avoid pointer gymnastics


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/bind/dist/lib/isc/sha2.c
cvs rdiff -u -r1.1.1.21 -r1.2 src/external/bsd/dhcpcd/dist/if-bsd.c

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

Modified files:

Index: src/external/bsd/bind/dist/lib/isc/sha2.c
diff -u src/external/bsd/bind/dist/lib/isc/sha2.c:1.5 src/external/bsd/bind/dist/lib/isc/sha2.c:1.6
--- src/external/bsd/bind/dist/lib/isc/sha2.c:1.5	Mon Jun  4 20:42:31 2012
+++ src/external/bsd/bind/dist/lib/isc/sha2.c	Sat Oct 19 23:14:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sha2.c,v 1.5 2012/06/05 00:42:31 christos Exp $	*/
+/*	$NetBSD: sha2.c,v 1.6 2013/10/20 03:14:34 christos Exp $	*/
 
 /*
  * Copyright (C) 2005-2007, 2009, 2011, 2012  Internet Systems Consortium, Inc. (ISC)
@@ -887,7 +887,8 @@ isc_sha256_final(isc_uint8_t digest[], i
 			*context-buffer = 0x80;
 		}
 		/* Set the bit count: */
-		*(isc_uint64_t*)context-buffer[ISC_SHA256_SHORT_BLOCK_LENGTH] = context-bitcount;
+		memcpy(context-buffer[ISC_SHA256_SHORT_BLOCK_LENGTH],
+		context-bitcount, sizeof(isc_uint64_t));
 
 		/* Final transform: */
 		isc_sha256_transform(context, (isc_uint32_t*)context-buffer);
@@ -1198,8 +1199,8 @@ void isc_sha512_last(isc_sha512_t *conte
 		*context-buffer = 0x80;
 	}
 	/* Store the length of input data (in bits): */
-	*(isc_uint64_t*)context-buffer[ISC_SHA512_SHORT_BLOCK_LENGTH] = context-bitcount[1];
-	*(isc_uint64_t*)context-buffer[ISC_SHA512_SHORT_BLOCK_LENGTH+8] = context-bitcount[0];
+	memcpy(context-buffer[ISC_SHA512_SHORT_BLOCK_LENGTH+8],
+	context-bitcount[0], sizeof(isc_uint64_t));
 
 	/* Final transform: */
 	isc_sha512_transform(context, (isc_uint64_t*)context-buffer);

Index: src/external/bsd/dhcpcd/dist/if-bsd.c
diff -u src/external/bsd/dhcpcd/dist/if-bsd.c:1.1.1.21 src/external/bsd/dhcpcd/dist/if-bsd.c:1.2
--- src/external/bsd/dhcpcd/dist/if-bsd.c:1.1.1.21	Fri Sep 20 06:51:29 2013
+++ src/external/bsd/dhcpcd/dist/if-bsd.c	Sat Oct 19 23:14:34 2013
@@ -1,5 +1,5 @@
 #include sys/cdefs.h
- __RCSID($NetBSD: if-bsd.c,v 1.1.1.21 2013/09/20 10:51:29 roy Exp $);
+ __RCSID($NetBSD: if-bsd.c,v 1.2 2013/10/20 03:14:34 christos Exp $);
 
 /*
  * dhcpcd - DHCP client daemon
@@ -383,8 +383,9 @@ if_route6(const struct rt6 *rt, int acti
 #ifdef __KAME__
 #define SCOPE {  \
 		if (IN6_IS_ADDR_LINKLOCAL(su.sin.sin6_addr)) {		  \
-			*(uint16_t *)(void *)su.sin.sin6_addr.s6_addr[2] =   \
-			htons(su.sin.sin6_scope_id);		  \
+			uint16_t scope = htons(su.sin.sin6_scope_id);	  \
+			memcpy(su.sin.sin6_addr.s6_addr[2], scope,	  \
+			sizeof(scope));   \
 			su.sin.sin6_scope_id = 0;			  \
 		}			  \
 	}



CVS commit: src/external/bsd

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:13:44 UTC 2013

Modified Files:
src/external/bsd/am-utils/dist/hlfsd: hlfsd.c
src/external/bsd/am-utils/dist/libamu: mount_fs.c
src/external/bsd/flex/dist: filter.c scanopt.c
src/external/bsd/mdocml/dist: roff.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/am-utils/dist/hlfsd/hlfsd.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/am-utils/dist/libamu/mount_fs.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/flex/dist/filter.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/flex/dist/scanopt.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/mdocml/dist/roff.c

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

Modified files:

Index: src/external/bsd/am-utils/dist/hlfsd/hlfsd.c
diff -u src/external/bsd/am-utils/dist/hlfsd/hlfsd.c:1.1.1.2 src/external/bsd/am-utils/dist/hlfsd/hlfsd.c:1.2
--- src/external/bsd/am-utils/dist/hlfsd/hlfsd.c:1.1.1.2	Fri Mar 20 16:26:55 2009
+++ src/external/bsd/am-utils/dist/hlfsd/hlfsd.c	Sat Oct 19 23:13:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: hlfsd.c,v 1.1.1.2 2009/03/20 20:26:55 christos Exp $	*/
+/*	$NetBSD: hlfsd.c,v 1.2 2013/10/20 03:13:44 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2009 Erez Zadok
@@ -150,7 +150,6 @@ main(int argc, char *argv[])
   int opterrs = 0;
   int retry;
   int soNFS;			/* NFS socket */
-  int s = -99;
   mntent_t mnt;
   nfs_args_t nfs_args;
   am_nfs_handle_t anh;
@@ -454,17 +453,16 @@ main(int argc, char *argv[])
* set this signal handler.
*/
   if (amuDebug(D_DAEMON)) {
-s = -99;
 while (stoplight != SIGUSR2) {
   plog(XLOG_INFO, parent waits for child to setup (stoplight=%d), stoplight);
 #ifdef HAVE_SIGSUSPEND
   {
 	sigset_t mask;
 	sigemptyset(mask);
-	s = sigsuspend(mask);	/* wait for child to set up */
+	(void)sigsuspend(mask);	/* wait for child to set up */
   }
 #else /* not HAVE_SIGSUSPEND */
-  s = sigpause(0);		/* wait for child to set up */
+  (void)sigpause(0);		/* wait for child to set up */
 #endif /* not HAVE_SIGSUSPEND */
   sleep(1);
 }

Index: src/external/bsd/am-utils/dist/libamu/mount_fs.c
diff -u src/external/bsd/am-utils/dist/libamu/mount_fs.c:1.1.1.2 src/external/bsd/am-utils/dist/libamu/mount_fs.c:1.2
--- src/external/bsd/am-utils/dist/libamu/mount_fs.c:1.1.1.2	Fri Mar 20 16:26:55 2009
+++ src/external/bsd/am-utils/dist/libamu/mount_fs.c	Sat Oct 19 23:13:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_fs.c,v 1.1.1.2 2009/03/20 20:26:55 christos Exp $	*/
+/*	$NetBSD: mount_fs.c,v 1.2 2013/10/20 03:13:44 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2009 Erez Zadok
@@ -466,6 +466,7 @@ compute_nfs_attrcache_flags(nfs_args_t *
   if (amu_hasmntopt(mntp, MNTTAB_OPT_NOAC) != NULL)
 nap-flags |= MNT2_NFS_OPT_NOAC;
 #endif /* defined(MNTTAB_OPT_NOAC)  defined(MNT2_NFS_OPT_NOAC) */
+  (void)err_acval;
 }
 
 

Index: src/external/bsd/flex/dist/filter.c
diff -u src/external/bsd/flex/dist/filter.c:1.2 src/external/bsd/flex/dist/filter.c:1.3
--- src/external/bsd/flex/dist/filter.c:1.2	Sat Apr  6 10:27:52 2013
+++ src/external/bsd/flex/dist/filter.c	Sat Oct 19 23:13:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: filter.c,v 1.2 2013/04/06 14:27:52 christos Exp $	*/
+/*	$NetBSD: filter.c,v 1.3 2013/10/20 03:13:44 christos Exp $	*/
 
 /* filter - postprocessing of flex output through filters */
 
@@ -363,11 +363,10 @@ int filter_fix_linedirs (struct filter *
 		if (buf[0] == '#'
 			 regexec (regex_linedir, buf, 3, m, 0) == 0) {
 
-			int num;
 			char   *fname;
 
 			/* extract the line number and filename */
-			num = regmatch_strtol (m[1], buf, NULL, 0);
+			(void)regmatch_strtol (m[1], buf, NULL, 0);
 			fname = regmatch_dup (m[2], buf);
 
 			if (strcmp (fname,

Index: src/external/bsd/flex/dist/scanopt.c
diff -u src/external/bsd/flex/dist/scanopt.c:1.3 src/external/bsd/flex/dist/scanopt.c:1.4
--- src/external/bsd/flex/dist/scanopt.c:1.3	Sat Apr  6 10:27:52 2013
+++ src/external/bsd/flex/dist/scanopt.c	Sat Oct 19 23:13:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: scanopt.c,v 1.3 2013/04/06 14:27:52 christos Exp $	*/
+/*	$NetBSD: scanopt.c,v 1.4 2013/10/20 03:13:44 christos Exp $	*/
 
 /* flex - tool to generate fast lexical analyzers */
 
@@ -539,10 +539,6 @@ static int scanopt_err (s, opt_offset, i
 {
 	const char *optname = ;
 	charoptchar[2];
-	const optspec_t *opt = NULL;
-
-	if (opt_offset = 0)
-		opt = s-options + opt_offset;
 
 	if (!s-no_err_msg) {
 

Index: src/external/bsd/mdocml/dist/roff.c
diff -u src/external/bsd/mdocml/dist/roff.c:1.13 src/external/bsd/mdocml/dist/roff.c:1.14
--- src/external/bsd/mdocml/dist/roff.c:1.13	Tue Apr  2 21:05:16 2013
+++ src/external/bsd/mdocml/dist/roff.c	Sat Oct 19 23:13:44 2013
@@ -1394,11 +1394,10 @@ roff_expand_nr(struct roff *r, const cha
 {
 	uint32_t	 hv;
 	struct roff_nr	*h;
-	int		 l, s, d;
+	int		 l, s;
 	char		 e, *key;
 
 

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

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:14:21 UTC 2013

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

Log Message:
fix unused variable warnings


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

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

Modified files:

Index: src/external/bsd/bzip2/dist/bzip2.c
diff -u src/external/bsd/bzip2/dist/bzip2.c:1.3 src/external/bsd/bzip2/dist/bzip2.c:1.4
--- src/external/bsd/bzip2/dist/bzip2.c:1.3	Sun May  6 20:45:47 2012
+++ src/external/bsd/bzip2/dist/bzip2.c	Sat Oct 19 23:14:21 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bzip2.c,v 1.3 2012/05/07 00:45:47 wiz Exp $	*/
+/*	$NetBSD: bzip2.c,v 1.4 2013/10/20 03:14:21 christos Exp $	*/
 
 
 /*---*/
@@ -557,7 +557,7 @@ static 
 Bool testStream ( FILE *zStream )
 {
BZFILE* bzf = NULL;
-   Int32   bzerr, bzerr_dummy, ret, nread, streamNo, i;
+   Int32   bzerr, bzerr_dummy, ret, streamNo, i;
UChar   obuf[5000];
UChar   unused[BZ_MAX_UNUSED];
Int32   nUnused;
@@ -580,7 +580,7 @@ Bool testStream ( FILE *zStream )
   streamNo++;
 
   while (bzerr == BZ_OK) {
- nread = BZ2_bzRead ( bzerr, bzf, obuf, 5000 );
+ (void)BZ2_bzRead ( bzerr, bzf, obuf, 5000 );
  if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
   }
   if (bzerr != BZ_STREAM_END) goto errhandler;



CVS commit: src/crypto/external/bsd/openssh/dist

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:35:33 UTC 2013

Modified Files:
src/crypto/external/bsd/openssh/dist: sshconnect2.c

Log Message:
- provide the right size to the zeroing memory function
- remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/crypto/external/bsd/openssh/dist/sshconnect2.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/sshconnect2.c
diff -u src/crypto/external/bsd/openssh/dist/sshconnect2.c:1.13 src/crypto/external/bsd/openssh/dist/sshconnect2.c:1.14
--- src/crypto/external/bsd/openssh/dist/sshconnect2.c:1.13	Mon Apr 29 13:59:50 2013
+++ src/crypto/external/bsd/openssh/dist/sshconnect2.c	Sat Oct 19 23:35:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sshconnect2.c,v 1.13 2013/04/29 17:59:50 mlelstv Exp $	*/
+/*	$NetBSD: sshconnect2.c,v 1.14 2013/10/20 03:35:32 christos Exp $	*/
 /* $OpenBSD: sshconnect2.c,v 1.192 2013/02/17 23:16:57 dtucker Exp $ */
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: sshconnect2.c,v 1.13 2013/04/29 17:59:50 mlelstv Exp $);
+__RCSID($NetBSD: sshconnect2.c,v 1.14 2013/10/20 03:35:32 christos Exp $);
 #include sys/types.h
 #include sys/socket.h
 #include sys/wait.h
@@ -845,7 +845,7 @@ input_gssapi_errtok(int type, u_int32_t 
 	Gssctxt *gssctxt;
 	gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
 	gss_buffer_desc recv_tok;
-	OM_uint32 status, ms;
+	OM_uint32 ms;
 	u_int len;
 
 	if (authctxt == NULL)
@@ -858,7 +858,7 @@ input_gssapi_errtok(int type, u_int32_t 
 	packet_check_eom();
 
 	/* Stick it into GSSAPI and see what it says */
-	status = ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
+	(void)ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
 	recv_tok, send_tok, NULL);
 
 	xfree(recv_tok.value);
@@ -871,12 +871,11 @@ input_gssapi_errtok(int type, u_int32_t 
 void
 input_gssapi_error(int type, u_int32_t plen, void *ctxt)
 {
-	OM_uint32 maj, min;
 	char *msg;
 	char *lang;
 
-	maj=packet_get_int();
-	min=packet_get_int();
+	(void)packet_get_int();	/* max */
+	(void)packet_get_int();	/* min */
 	msg=packet_get_string(NULL);
 	lang=packet_get_string(NULL);
 
@@ -1445,7 +1444,7 @@ pubkey_prepare(Authctxt *authctxt)
 		/* If IdentitiesOnly set and key not found then don't use it */
 		if (!found  options.identities_only) {
 			TAILQ_REMOVE(files, id, next);
-			bzero(id, sizeof(id));
+			memset(id, 0, sizeof(*id));
 			free(id);
 		}
 	}



CVS commit: src/crypto/external/bsd/openssh/dist

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:34:58 UTC 2013

Modified Files:
src/crypto/external/bsd/openssh/dist: auth1.c

Log Message:
fix wrong argument to sizeof.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssh/dist/auth1.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/auth1.c
diff -u src/crypto/external/bsd/openssh/dist/auth1.c:1.6 src/crypto/external/bsd/openssh/dist/auth1.c:1.7
--- src/crypto/external/bsd/openssh/dist/auth1.c:1.6	Fri Mar 29 12:19:44 2013
+++ src/crypto/external/bsd/openssh/dist/auth1.c	Sat Oct 19 23:34:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: auth1.c,v 1.6 2013/03/29 16:19:44 christos Exp $	*/
+/*	$NetBSD: auth1.c,v 1.7 2013/10/20 03:34:58 christos Exp $	*/
 /* $OpenBSD: auth1.c,v 1.77 2012/12/02 20:34:09 djm Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen y...@cs.hut.fi, Espoo, Finland
@@ -12,7 +12,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: auth1.c,v 1.6 2013/03/29 16:19:44 christos Exp $);
+__RCSID($NetBSD: auth1.c,v 1.7 2013/10/20 03:34:58 christos Exp $);
 #include sys/types.h
 #include sys/queue.h
 
@@ -162,7 +162,7 @@ auth1_process_kerberos(Authctxt *authctx
 
 		if (PRIVSEP(auth_krb4(authctxt, tkt, client_user, reply))) {
 			authenticated = 1;
-			snprintf(info, sizeof(info),  tktuser %.100s,
+			snprintf(info, infolen,  tktuser %.100s,
 			client_user);
 
 			packet_start(SSH_SMSG_AUTH_KERBEROS_RESPONSE);
@@ -182,7 +182,7 @@ auth1_process_kerberos(Authctxt *authctx
 
 		if (PRIVSEP(auth_krb5(authctxt, tkt, client_user, reply))) {
 			authenticated = 1;
-			snprintf(info, sizeof(info),  tktuser %.100s,
+			snprintf(info, infolen,  tktuser %.100s,
 			client_user);
 
 			/* Send response to client */



CVS commit: src/crypto/external/bsd/openssh/dist

2013-10-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 20 03:35:59 UTC 2013

Modified Files:
src/crypto/external/bsd/openssh/dist: auth2-gss.c

Log Message:
remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/openssh/dist/auth2-gss.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/auth2-gss.c
diff -u src/crypto/external/bsd/openssh/dist/auth2-gss.c:1.4 src/crypto/external/bsd/openssh/dist/auth2-gss.c:1.5
--- src/crypto/external/bsd/openssh/dist/auth2-gss.c:1.4	Fri Mar 29 12:19:44 2013
+++ src/crypto/external/bsd/openssh/dist/auth2-gss.c	Sat Oct 19 23:35:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: auth2-gss.c,v 1.4 2013/03/29 16:19:44 christos Exp $	*/
+/*	$NetBSD: auth2-gss.c,v 1.5 2013/10/20 03:35:59 christos Exp $	*/
 /* $OpenBSD: auth2-gss.c,v 1.18 2012/12/02 20:34:09 djm Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: auth2-gss.c,v 1.4 2013/03/29 16:19:44 christos Exp $);
+__RCSID($NetBSD: auth2-gss.c,v 1.5 2013/10/20 03:35:59 christos Exp $);
 
 #ifdef GSSAPI
 
@@ -229,14 +229,11 @@ static void
 input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
 {
 	Authctxt *authctxt = ctxt;
-	Gssctxt *gssctxt;
 	int authenticated;
 
 	if (authctxt == NULL || (authctxt-methoddata == NULL  !use_privsep))
 		fatal(No authentication or GSSAPI context);
 
-	gssctxt = authctxt-methoddata;
-
 	/*
 	 * We don't need to check the status, because we're only enabled in
 	 * the dispatcher once the exchange is complete



CVS commit: src/sys/sys

2013-10-19 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Sat Oct 19 08:03:52 UTC 2013

Modified Files:
src/sys/sys: disklabel_gpt.h

Log Message:
add FreeBSD ZFS partition type


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/disklabel_gpt.h

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



CVS commit: src/sbin/gpt

2013-10-19 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Sat Oct 19 08:13:21 UTC 2013

Modified Files:
src/sbin/gpt: migrate.c

Log Message:
- convert FreeBSD FS_type to numbers where they don't match NetBSD
- add support for migrating NetBSD disklabel'ed disks (only 7 years late)
- use labels for partition types


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/migrate.c

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



CVS commit: src/sbin/gpt

2013-10-19 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Sat Oct 19 09:31:24 UTC 2013

Modified Files:
src/sbin/gpt: migrate.c

Log Message:
Convert FreeBSD numeric FS_types to labels by request.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/migrate.c

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



  1   2   >