CVS commit: src/sys/netinet

2016-02-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Feb 25 06:00:01 UTC 2016

Modified Files:
src/sys/netinet: in.c

Log Message:
Use callout_halt instead of callout_stop


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/netinet/in.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/netinet/in.c
diff -u src/sys/netinet/in.c:1.163 src/sys/netinet/in.c:1.164
--- src/sys/netinet/in.c:1.163	Thu Nov 26 01:41:20 2015
+++ src/sys/netinet/in.c	Thu Feb 25 06:00:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.163 2015/11/26 01:41:20 ozaki-r Exp $	*/
+/*	$NetBSD: in.c,v 1.164 2016/02/25 06:00:01 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.163 2015/11/26 01:41:20 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.164 2016/02/25 06:00:01 ozaki-r Exp $");
 
 #include "arp.h"
 
@@ -1620,7 +1620,7 @@ in_lltable_free_entry(struct lltable *ll
 	}
 
 	/* cancel timer */
-	if (callout_stop(>lle_timer))
+	if (callout_halt(>lle_timer, >lle_lock))
 		LLE_REMREF(lle);
 
 	/* Drop hold queue */



CVS commit: xsrc/external/mit/libdrm/dist

2016-02-24 Thread Taylor R Campbell
Module Name:xsrc
Committed By:   riastradh
Date:   Thu Feb 25 05:01:21 UTC 2016

Modified Files:
xsrc/external/mit/libdrm/dist: xf86atomic.h

Log Message:
The unsigned int object must be volatile-qualified too.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libdrm/dist/xf86atomic.h

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

Modified files:

Index: xsrc/external/mit/libdrm/dist/xf86atomic.h
diff -u xsrc/external/mit/libdrm/dist/xf86atomic.h:1.8 xsrc/external/mit/libdrm/dist/xf86atomic.h:1.9
--- xsrc/external/mit/libdrm/dist/xf86atomic.h:1.8	Thu Feb 25 04:48:24 2016
+++ xsrc/external/mit/libdrm/dist/xf86atomic.h	Thu Feb 25 05:01:21 2016
@@ -88,7 +88,7 @@ typedef struct {
 #define LIBDRM_ATOMIC_TYPE uint_t
 #endif
 
-typedef struct { LIBDRM_ATOMIC_TYPE atomic; } atomic_t;
+typedef struct { volatile LIBDRM_ATOMIC_TYPE atomic; } atomic_t;
 
 # define atomic_read(x) (int) ((x)->atomic)
 # define atomic_set(x, val) ((x)->atomic = (LIBDRM_ATOMIC_TYPE)(val))



CVS commit: xsrc/external/mit/libdrm/dist

2016-02-24 Thread Taylor R Campbell
Module Name:xsrc
Committed By:   riastradh
Date:   Thu Feb 25 04:48:24 UTC 2016

Modified Files:
xsrc/external/mit/libdrm/dist: xf86atomic.h

Log Message:
Use unsigned int, not int, for LIBDRM_ATOMIC_TYPE.

Otherwise we pass int * to atomic_..._uint operations that expect
unsigned int *.

(Not clear to me why GCC doesn't warn about a pointer signedness
issue here but Clang does.)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/libdrm/dist/xf86atomic.h

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

Modified files:

Index: xsrc/external/mit/libdrm/dist/xf86atomic.h
diff -u xsrc/external/mit/libdrm/dist/xf86atomic.h:1.7 xsrc/external/mit/libdrm/dist/xf86atomic.h:1.8
--- xsrc/external/mit/libdrm/dist/xf86atomic.h:1.7	Tue Oct 13 02:59:39 2015
+++ xsrc/external/mit/libdrm/dist/xf86atomic.h	Thu Feb 25 04:48:24 2016
@@ -83,7 +83,7 @@ typedef struct {
 #define HAS_ATOMIC_OPS 1
 
 #if defined(__NetBSD__)
-#define LIBDRM_ATOMIC_TYPE int
+#define LIBDRM_ATOMIC_TYPE unsigned int
 #else
 #define LIBDRM_ATOMIC_TYPE uint_t
 #endif



CVS commit: src/tests/net/arp

2016-02-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Feb 25 03:23:15 UTC 2016

Modified Files:
src/tests/net/arp: t_arp.sh

Log Message:
Add basic tests for Proxy ARP

The tests don't much enough and need more realitic tests, for example
tests for a setup using ppp found in PR 44032.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/net/arp/t_arp.sh

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

Modified files:

Index: src/tests/net/arp/t_arp.sh
diff -u src/tests/net/arp/t_arp.sh:1.10 src/tests/net/arp/t_arp.sh:1.11
--- src/tests/net/arp/t_arp.sh:1.10	Wed Dec  2 06:05:14 2015
+++ src/tests/net/arp/t_arp.sh	Thu Feb 25 03:23:15 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_arp.sh,v 1.10 2015/12/02 06:05:14 ozaki-r Exp $
+#	$NetBSD: t_arp.sh,v 1.11 2016/02/25 03:23:15 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -32,6 +32,10 @@ SOCKSRC=unix://commsock1
 SOCKDST=unix://commsock2
 IP4SRC=10.0.1.1
 IP4DST=10.0.1.2
+IP4DST_PUB=10.0.1.3
+MACDST_PUB=b2:a1:00:00:00:01
+IP4DST_PUBPROXY=10.0.1.4
+MACDST_PUBPROXY=b2:a1:00:00:00:02
 
 DEBUG=false
 TIMEOUT=1
@@ -41,6 +45,7 @@ atf_test_case cache_expiration_10s clean
 atf_test_case command cleanup
 atf_test_case garp cleanup
 atf_test_case cache_overwriting cleanup
+atf_test_case pubproxy_arp cleanup
 
 cache_expiration_5s_head()
 {
@@ -72,6 +77,12 @@ cache_overwriting_head()
 	atf_set "require.progs" "rump_server"
 }
 
+pubproxy_arp_head()
+{
+	atf_set "descr" "Tests for Proxy ARP"
+	atf_set "require.progs" "rump_server"
+}
+
 setup_dst_server()
 {
 	export RUMP_SERVER=$SOCKDST
@@ -225,7 +236,7 @@ command_body()
 	return 0
 }
 
-make_pkt_str()
+make_pkt_str_arpreq()
 {
 	local target=$1
 	local sender=$2
@@ -253,10 +264,10 @@ garp_body()
 	shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r - > ./out
 
 	# A GARP packet is sent for the primary address
-	pkt=$(make_pkt_str 10.0.0.1 10.0.0.1)
+	pkt=$(make_pkt_str_arpreq 10.0.0.1 10.0.0.1)
 	atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
 	# No GARP packet is sent for the alias address
-	pkt=$(make_pkt_str 10.0.0.2 10.0.0.2)
+	pkt=$(make_pkt_str_arpreq 10.0.0.2 10.0.0.2)
 	atf_check -s not-exit:0 -x "cat ./out |grep -q '$pkt'"
 
 	atf_check -s exit:0 rump.ifconfig -w 10
@@ -265,9 +276,9 @@ garp_body()
 
 	# No GARP packets are sent during IFF_UP
 	shmif_dumpbus -p - bus1 2>/dev/null| tcpdump -n -e -r - > ./out
-	pkt=$(make_pkt_str 10.0.0.3 10.0.0.3)
+	pkt=$(make_pkt_str_arpreq 10.0.0.3 10.0.0.3)
 	atf_check -s not-exit:0 -x "cat ./out |grep -q '$pkt'"
-	pkt=$(make_pkt_str 10.0.0.4 10.0.0.4)
+	pkt=$(make_pkt_str_arpreq 10.0.0.4 10.0.0.4)
 	atf_check -s not-exit:0 -x "cat ./out |grep -q '$pkt'"
 }
 
@@ -309,6 +320,94 @@ cache_overwriting_body()
 	return 0
 }
 
+make_pkt_str_arprep()
+{
+	local ip=$1
+	local mac=$2
+	pkt="ethertype ARP (0x0806), length 42: "
+	pkt="Reply $ip is-at $mac, length 28"
+	echo $pkt
+}
+
+extract_new_packets()
+{
+	local old=./old
+
+	if [ ! -f $old ]; then
+		old=/dev/null
+	fi
+
+	shmif_dumpbus -p - bus1 2>/dev/null| \
+	tcpdump -n -e -r - 2>/dev/null > ./new
+	diff -u $old ./new |grep '^+' |cut -d '+' -f 2 > ./diff
+	mv -f ./new ./old
+	cat ./diff
+}
+
+check_entry_flags()
+{
+	local ip=$(echo $1 |sed 's/\./\\./g')
+	local flags=$2
+
+	atf_check -s exit:0 -o match:" $flags " -e ignore -x \
+	"rump.netstat -rn -f inet | grep ^'$ip'"
+}
+
+pubproxy_arp_body()
+{
+	local arp_keep=5
+
+	atf_check -s exit:0 ${inetserver} $SOCKSRC
+	atf_check -s exit:0 ${inetserver} $SOCKDST
+
+	setup_dst_server
+	setup_src_server $arp_keep
+
+	export RUMP_SERVER=$SOCKDST
+
+	atf_check -s exit:0 -o ignore rump.arp -s $IP4DST_PUB \
+	$MACDST_PUB pub
+	atf_check -s exit:0 -o match:'permanent published' \
+	rump.arp -n $IP4DST_PUB
+	check_entry_flags $IP4DST_PUB ULSp
+
+	$DEBUG && rump.arp -n -a
+	$DEBUG && rump.netstat -nr -f inet
+
+	atf_check -s exit:0 -o ignore rump.arp -s $IP4DST_PUBPROXY \
+	$MACDST_PUBPROXY pub proxy
+	atf_check -s exit:0 -o match:'permanent published \(proxy only\)' \
+	rump.arp -n $IP4DST_PUBPROXY
+	check_entry_flags $IP4DST_PUBPROXY UHLSp
+
+	$DEBUG && rump.arp -n -a
+	$DEBUG && rump.netstat -nr -f inet
+
+	export RUMP_SERVER=$SOCKSRC
+
+	atf_check -s not-exit:0 -o ignore -e ignore \
+	rump.ping -n -w 1 -c 1 $IP4DST_PUB
+
+	atf_check -s exit:0 sleep 1
+	extract_new_packets > ./out
+	$DEBUG && cat ./out
+
+	pkt=$(make_pkt_str_arprep $IP4DST_PUB $MACDST_PUB)
+	atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
+
+	atf_check -s not-exit:0 -o ignore -e ignore \
+	rump.ping -n -w 1 -c 1 $IP4DST_PUBPROXY
+
+	atf_check -s exit:0 sleep 1
+	extract_new_packets > ./out
+	$DEBUG && cat ./out
+
+	pkt=$(make_pkt_str_arprep $IP4DST_PUBPROXY $MACDST_PUBPROXY)
+	atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
+
+	return 0
+}
+
 cleanup()
 {
 	env RUMP_SERVER=$SOCKSRC rump.halt
@@ -371,6 +470,12 @@ cache_overwriting_cleanup()
 	

CVS commit: src/sys/external/bsd/dwc2

2016-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 24 22:17:54 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2: dwc2.c dwc2.h
src/sys/external/bsd/dwc2/conf: files.dwc2
src/sys/external/bsd/dwc2/dist: dwc2_core.c dwc2_core.h dwc2_coreintr.c
dwc2_hcd.c dwc2_hcd.h

Log Message:
Reduce diff to upstream by using

sys/external/bsd/{include/workqueue.h,linux/linux_work.c}

This also fixes CI20 dwctwo start up as reported by macallan@


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/external/bsd/dwc2/dwc2.c
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/dwc2/dwc2.h
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/dwc2/conf/files.dwc2
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/dwc2/dist/dwc2_core.c \
src/sys/external/bsd/dwc2/dist/dwc2_hcd.h
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/dwc2/dist/dwc2_core.h
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/dwc2/dist/dwc2_coreintr.c
cvs rdiff -u -r1.18 -r1.19 src/sys/external/bsd/dwc2/dist/dwc2_hcd.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/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.40 src/sys/external/bsd/dwc2/dwc2.c:1.41
--- src/sys/external/bsd/dwc2/dwc2.c:1.40	Wed Feb 24 22:09:09 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Wed Feb 24 22:17:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.40 2016/02/24 22:09:09 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.41 2016/02/24 22:17:54 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.40 2016/02/24 22:09:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.41 2016/02/24 22:17:54 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1453,45 +1453,6 @@ fail:
 
 }
 
-#if IS_ENABLED(CONFIG_USB_DWC2_HOST) || IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
-void
-dwc2_worker(struct work *wk, void *priv)
-{
-	struct dwc2_softc *sc = priv;
-	struct dwc2_hsotg *hsotg = sc->sc_hsotg;
-
-Debugger();
-#if 0
-	usbd_xfer_handle xfer = dwork->xfer;
-	struct dwc2_xfer *dxfer = DWC2_XFER2DXFER(xfer);
-
-	dwc2_hcd_endpoint_disable(sc->dwc_dev.hcd, dpipe->priv, 250);
-	dwc_free(NULL, dpipe->urb);
-#endif
-
-	mutex_enter(>sc_lock);
-	if (wk == >wf_otg) {
-		dwc2_conn_id_status_change(wk);
-	} else if (wk == >start_work.work) {
-		dwc2_hcd_start_func(wk);
-	} else if (wk == >reset_work.work) {
-		dwc2_hcd_reset_func(wk);
-	} else {
-#if 0
-		KASSERT(dwork->xfer != NULL);
-		KASSERT(dxfer->queued == true);
-
-		if (!(xfer->hcflags & UXFER_ABORTING)) {
-			dwc2_start_standard_chain(xfer);
-		}
-		dxfer->queued = false;
-		cv_broadcast(>hccv);
-#endif
-	}
-	mutex_exit(>sc_lock);
-}
-#endif
-
 int dwc2_intr(void *p)
 {
 	struct dwc2_softc *sc = p;
@@ -1723,15 +1684,6 @@ static const char * const intnames[32] =
 
 #endif
 
-
-void
-dw_callout(void *arg)
-{
-	struct delayed_work *dw = arg;
-
-	workqueue_enqueue(dw->dw_wq, >work, NULL);
-}
-
 void dwc2_host_hub_info(struct dwc2_hsotg *hsotg, void *context, int *hub_addr,
 			int *hub_port)
 {

Index: src/sys/external/bsd/dwc2/dwc2.h
diff -u src/sys/external/bsd/dwc2/dwc2.h:1.8 src/sys/external/bsd/dwc2/dwc2.h:1.9
--- src/sys/external/bsd/dwc2/dwc2.h:1.8	Fri Feb 19 21:10:18 2016
+++ src/sys/external/bsd/dwc2/dwc2.h	Wed Feb 24 22:17:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.h,v 1.8 2016/02/19 21:10:18 skrll Exp $	*/
+/*	$NetBSD: dwc2.h,v 1.9 2016/02/24 22:17:54 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
 #include 
 
 #include 
+#include 
 
 #include "opt_usb.h"
 // #define VERBOSE_DEBUG
@@ -277,26 +278,4 @@ msleep(unsigned int msec)
 
 #define USB_RESUME_TIMEOUT	40 /* ms */
 
-void dw_callout(void *);
-void dwc2_worker(struct work *, void *);
-
-struct delayed_work {
-	struct work work;
-	struct callout dw_timer;
-
-	struct workqueue *dw_wq;
-};
-
-static inline void
-INIT_DELAYED_WORK(struct delayed_work *dw, void (*fn)(struct work *))
-{
-	callout_init(>dw_timer, CALLOUT_MPSAFE);
-}
-
-static inline void
-queue_delayed_work(struct workqueue *wq, struct delayed_work *dw, int j)
-{
-	callout_reset(>dw_timer, j, dw_callout, dw);
-}
-
 #endif

Index: src/sys/external/bsd/dwc2/conf/files.dwc2
diff -u src/sys/external/bsd/dwc2/conf/files.dwc2:1.2 src/sys/external/bsd/dwc2/conf/files.dwc2:1.3
--- src/sys/external/bsd/dwc2/conf/files.dwc2:1.2	Fri Sep 12 16:40:38 2014
+++ src/sys/external/bsd/dwc2/conf/files.dwc2	Wed Feb 24 22:17:54 2016
@@ -1,11 +1,12 @@
-#	$NetBSD: files.dwc2,v 1.2 2014/09/12 16:40:38 skrll Exp $
+#	$NetBSD: files.dwc2,v 1.3 2016/02/24 22:17:54 skrll Exp $
 
 # DesignWare HS OTG Controller
 #
-device dwctwo: usbus, usbroothub, usb_dma
+
+device dwctwo: usbus, usbroothub, usb_dma, linux
 file	external/bsd/dwc2/dwc2.c			dwctwo	needs-flag
 
-makeoptions	dwctwo	CPPFLAGS+=" -I$S/external/bsd/common/include -I$S/external/bsd -I$S/external/bsd/dwc2/dist"

CVS commit: src/sys/external/bsd/dwc2/dist

2016-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 24 22:14:39 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2/dist: dwc2_core.c dwc2_hcdddma.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/dwc2/dist/dwc2_core.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.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/external/bsd/dwc2/dist/dwc2_core.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_core.c:1.11 src/sys/external/bsd/dwc2/dist/dwc2_core.c:1.12
--- src/sys/external/bsd/dwc2/dist/dwc2_core.c:1.11	Sun Feb 14 10:53:30 2016
+++ src/sys/external/bsd/dwc2/dist/dwc2_core.c	Wed Feb 24 22:14:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_core.c,v 1.11 2016/02/14 10:53:30 skrll Exp $	*/
+/*	$NetBSD: dwc2_core.c,v 1.12 2016/02/24 22:14:39 skrll Exp $	*/
 
 /*
  * core.c - DesignWare HS OTG Controller common routines
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_core.c,v 1.11 2016/02/14 10:53:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_core.c,v 1.12 2016/02/24 22:14:39 skrll Exp $");
 
 #include 
 #include 
@@ -2102,7 +2102,7 @@ void dwc2_hc_start_transfer_ddma(struct 
 			dev_vdbg(hsotg->dev, "Wrote %pad to ext dma(%d)\n",
 >desc_list_addr, chan->hc_num);
 	}
-	
+
 	hcchar = DWC2_READ_4(hsotg, HCCHAR(chan->hc_num));
 	hcchar &= ~HCCHAR_MULTICNT_MASK;
 	hcchar |= chan->multi_count << HCCHAR_MULTICNT_SHIFT &

Index: src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c
diff -u src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.7 src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.8
--- src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c:1.7	Sun Feb 14 10:53:30 2016
+++ src/sys/external/bsd/dwc2/dist/dwc2_hcdddma.c	Wed Feb 24 22:14:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2_hcdddma.c,v 1.7 2016/02/14 10:53:30 skrll Exp $	*/
+/*	$NetBSD: dwc2_hcdddma.c,v 1.8 2016/02/24 22:14:39 skrll Exp $	*/
 
 /*
  * hcd_ddma.c - DesignWare HS OTG Controller descriptor DMA routines
@@ -40,7 +40,7 @@
  * This file contains the Descriptor DMA implementation for Host mode
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdddma.c,v 1.7 2016/02/14 10:53:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2_hcdddma.c,v 1.8 2016/02/24 22:14:39 skrll Exp $");
 
 #include 
 #include 
@@ -566,7 +566,7 @@ static void dwc2_fill_host_isoc_dma_desc
 		dma_desc->status |= HOST_DMA_IOC;
 #endif
 
-	usb_syncmem(>desc_list_usbdma, 
+	usb_syncmem(>desc_list_usbdma,
 	(idx * sizeof(struct dwc2_hcd_dma_desc)),
 	sizeof(struct dwc2_hcd_dma_desc),
 	BUS_DMASYNC_PREWRITE);
@@ -640,7 +640,7 @@ static void dwc2_init_isoc_dma_desc(stru
 		idx = dwc2_desclist_idx_dec(qh->td_last, inc, qh->dev_speed);
 		qh->desc_list[idx].status |= HOST_DMA_IOC;
 
-		usb_syncmem(>desc_list_usbdma, 
+		usb_syncmem(>desc_list_usbdma,
 		(idx * sizeof(struct dwc2_hcd_dma_desc)),
 		sizeof(struct dwc2_hcd_dma_desc),
 		BUS_DMASYNC_PREWRITE);
@@ -673,7 +673,7 @@ static void dwc2_init_isoc_dma_desc(stru
 		idx = dwc2_desclist_idx_dec(qh->td_last, inc, qh->dev_speed);
 
 	qh->desc_list[idx].status |= HOST_DMA_IOC;
-	usb_syncmem(>desc_list_usbdma, 
+	usb_syncmem(>desc_list_usbdma,
 	(idx * sizeof(struct dwc2_hcd_dma_desc)),
 	sizeof(struct dwc2_hcd_dma_desc),
 	BUS_DMASYNC_PREWRITE);
@@ -714,7 +714,7 @@ static void dwc2_fill_host_dma_desc(stru
 
 	dma_desc->buf = (u32)chan->xfer_dma;
 
-	usb_syncmem(>desc_list_usbdma, 
+	usb_syncmem(>desc_list_usbdma,
 	(n_desc * sizeof(struct dwc2_hcd_dma_desc)),
 	sizeof(struct dwc2_hcd_dma_desc),
 	BUS_DMASYNC_PREWRITE);
@@ -769,7 +769,7 @@ static void dwc2_init_non_isoc_dma_desc(
 	 "set A bit in desc %d (%p)\n",
 	 n_desc - 1,
 	 >desc_list[n_desc - 1]);
-usb_syncmem(>desc_list_usbdma, 
+usb_syncmem(>desc_list_usbdma,
 ((n_desc - 1) *
 sizeof(struct dwc2_hcd_dma_desc)),
 sizeof(struct dwc2_hcd_dma_desc),
@@ -799,7 +799,7 @@ static void dwc2_init_non_isoc_dma_desc(
 HOST_DMA_IOC | HOST_DMA_EOL | HOST_DMA_A;
 		dev_vdbg(hsotg->dev, "set IOC/EOL/A bits in desc %d (%p)\n",
 			 n_desc - 1, >desc_list[n_desc - 1]);
-		usb_syncmem(>desc_list_usbdma, 
+		usb_syncmem(>desc_list_usbdma,
 		((n_desc - 1) * sizeof(struct dwc2_hcd_dma_desc)),
 		sizeof(struct dwc2_hcd_dma_desc),
 		BUS_DMASYNC_PREWRITE);
@@ -896,7 +896,7 @@ static int dwc2_cmpl_host_isoc_dma_desc(
 	(idx * sizeof(struct dwc2_hcd_dma_desc)),
 	sizeof(struct dwc2_hcd_dma_desc),
 	BUS_DMASYNC_POSTREAD);
-	
+
 	dma_desc = >desc_list[idx];
 
 	frame_desc = >urb->iso_descs[qtd->isoc_frame_index_last];
@@ -1154,7 +1154,7 @@ static int dwc2_process_non_isoc_desc(st
 	if (!urb)
 		return -EINVAL;
 
-	usb_syncmem(>desc_list_usbdma, 
+	usb_syncmem(>desc_list_usbdma,
 	(desc_num * sizeof(struct dwc2_hcd_dma_desc)),
 	sizeof(struct dwc2_hcd_dma_desc),
 	

CVS commit: src/sys/external/bsd/dwc2

2016-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 24 22:09:09 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/external/bsd/dwc2/dwc2.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/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.39 src/sys/external/bsd/dwc2/dwc2.c:1.40
--- src/sys/external/bsd/dwc2/dwc2.c:1.39	Sun Feb 14 10:56:22 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Wed Feb 24 22:09:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.39 2016/02/14 10:56:22 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.40 2016/02/24 22:09:09 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.39 2016/02/14 10:56:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.40 2016/02/24 22:09:09 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1886,7 +1886,7 @@ _dwc2_hcd_start(struct dwc2_hsotg *hsotg
 	mutex_spin_enter(>lock);
 
 	hsotg->lx_state = DWC2_L0;
-	
+
 	if (dwc2_is_device_mode(hsotg)) {
 		mutex_spin_exit(>lock);
 		return 0;	/* why 0 ?? */



CVS commit: src/sys

2016-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 24 22:04:15 UTC 2016

Modified Files:
src/sys/conf: files
src/sys/external/bsd/drm2/drm: files.drmkms
src/sys/external/bsd/drm2/linux: files.drmkms_linux
src/sys/modules/drmkms_linux: Makefile
Added Files:
src/sys/external/bsd/common/include/linux: workqueue.h
src/sys/external/bsd/common/linux: linux_work.c
Removed Files:
src/sys/external/bsd/drm2/include/linux: workqueue.h
src/sys/external/bsd/drm2/linux: linux_work.c

Log Message:
Move linux_work.c and workqueue.h from sys/external/bsd/drm2 to
sys/external/common so that they can be used by others.

LGTM from riastradh@

These should really live outside sys/external, but that can be decided
later


To generate a diff of this commit:
cvs rdiff -u -r1.1152 -r1.1153 src/sys/conf/files
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/linux/workqueue.h
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/linux/linux_work.c
cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/drm/files.drmkms
cvs rdiff -u -r1.4 -r0 src/sys/external/bsd/drm2/include/linux/workqueue.h
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/linux/files.drmkms_linux
cvs rdiff -u -r1.12 -r0 src/sys/external/bsd/drm2/linux/linux_work.c
cvs rdiff -u -r1.6 -r1.7 src/sys/modules/drmkms_linux/Makefile

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1152 src/sys/conf/files:1.1153
--- src/sys/conf/files:1.1152	Wed Dec  9 18:25:32 2015
+++ src/sys/conf/files	Wed Feb 24 22:04:15 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1152 2015/12/09 18:25:32 maxv Exp $
+#	$NetBSD: files,v 1.1153 2016/02/24 22:04:15 skrll Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20150846
@@ -1146,6 +1146,9 @@ define drm {}
 include "external/bsd/drm/conf/files.drm"
 include "dev/drm/files.drm"
 
+# Linux API support
+include "external/bsd/common/conf/files.linux"
+
 # DRM/KMS - Newer direct rendering manager with kernel mode-switching
 include "external/bsd/drm2/drm/files.drmkms"
 

Index: src/sys/external/bsd/drm2/drm/files.drmkms
diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.12 src/sys/external/bsd/drm2/drm/files.drmkms:1.13
--- src/sys/external/bsd/drm2/drm/files.drmkms:1.12	Thu Aug 20 21:41:12 2015
+++ src/sys/external/bsd/drm2/drm/files.drmkms	Wed Feb 24 22:04:15 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.drmkms,v 1.12 2015/08/20 21:41:12 skrll Exp $
+#	$NetBSD: files.drmkms,v 1.13 2016/02/24 22:04:15 skrll Exp $
 
 include "external/bsd/drm2/linux/files.drmkms_linux"
 
@@ -8,7 +8,7 @@ include "external/bsd/drm2/linux/files.d
 # ARM SoC graphics drivers.
 define	drmkms_i2c: drmkms_linux
 
-define	drmkms: drmkms_linux, drmkms_i2c
+define	drmkms: drmkms_linux, drmkms_i2c, linux
 
 defflag		opt_drmkms.h	DRMKMS_DEBUG
 makeoptions 	drmkms	CPPFLAGS+="-I$S/external/bsd/drm2/include"

Index: src/sys/external/bsd/drm2/linux/files.drmkms_linux
diff -u src/sys/external/bsd/drm2/linux/files.drmkms_linux:1.8 src/sys/external/bsd/drm2/linux/files.drmkms_linux:1.9
--- src/sys/external/bsd/drm2/linux/files.drmkms_linux:1.8	Thu Jan  8 23:35:47 2015
+++ src/sys/external/bsd/drm2/linux/files.drmkms_linux	Wed Feb 24 22:04:15 2016
@@ -1,4 +1,4 @@
-#   $NetBSD: files.drmkms_linux,v 1.8 2015/01/08 23:35:47 riastradh Exp $
+#   $NetBSD: files.drmkms_linux,v 1.9 2016/02/24 22:04:15 skrll Exp $
 
 define	drmkms_linux: i2cexec, i2c_bitbang
 
@@ -11,6 +11,5 @@ file	external/bsd/drm2/linux/linux_i2c.c
 file	external/bsd/drm2/linux/linux_idr.c		drmkms_linux
 file	external/bsd/drm2/linux/linux_list_sort.c	drmkms_linux
 file	external/bsd/drm2/linux/linux_module.c		drmkms_linux
-file	external/bsd/drm2/linux/linux_work.c		drmkms_linux
 file	external/bsd/drm2/linux/linux_writecomb.c	drmkms_linux
 file	external/bsd/drm2/linux/linux_ww_mutex.c	drmkms_linux

Index: src/sys/modules/drmkms_linux/Makefile
diff -u src/sys/modules/drmkms_linux/Makefile:1.6 src/sys/modules/drmkms_linux/Makefile:1.7
--- src/sys/modules/drmkms_linux/Makefile:1.6	Thu Jan  8 23:35:47 2015
+++ src/sys/modules/drmkms_linux/Makefile	Wed Feb 24 22:04:15 2016
@@ -1,8 +1,15 @@
-# $NetBSD: Makefile,v 1.6 2015/01/08 23:35:47 riastradh Exp $
+# $NetBSD: Makefile,v 1.7 2016/02/24 22:04:15 skrll Exp $
+
+#
+# At some point this needs to turn into linux.kmod and a proper home for it
+# found.  For now pickup the linux_work.c from the (increasingly poorly
+# named) common area.
+#
 
 .include "../Makefile.inc"
 
 .PATH: ${S}/external/bsd/drm2/linux
+.PATH: ${S}/external/bsd/common/linux
 
 CPPFLAGS+=	-I${S}/external/bsd/common/include
 CPPFLAGS+=	-I${S}/external/bsd/drm2/include

Added files:

Index: src/sys/external/bsd/common/include/linux/workqueue.h
diff -u /dev/null src/sys/external/bsd/common/include/linux/workqueue.h:1.1
--- /dev/null	Wed Feb 24 22:04:16 2016
+++ 

CVS commit: src/external/cddl/osnet/dist/lib/libdtrace/common

2016-02-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Feb 24 21:11:35 UTC 2016

Modified Files:
src/external/cddl/osnet/dist/lib/libdtrace/common: dt_open.c

Log Message:
Make the default CPP path a list and check if they are access(2)able.
If no match is found, fallback to looking for cpp in PATH.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.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/libdtrace/common/dt_open.c
diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.9 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.10
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c:1.9	Wed Feb  3 17:50:12 2016
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_open.c	Wed Feb 24 21:11:34 2016
@@ -788,10 +788,10 @@ const dtrace_pattr_t _dtrace_prvdesc = {
 };
 
 #ifdef illumos
-const char *_dtrace_defcpp = "/usr/ccs/lib/cpp"; /* default cpp(1) to invoke */
+const char *_dtrace_defcpps[] = { "/usr/ccs/lib/cpp" }; /* default cpp(1) to invoke */
 const char *_dtrace_defld = "/usr/ccs/bin/ld";   /* default ld(1) to invoke */
 #else
-const char *_dtrace_defcpp = "cpp"; /* default cpp(1) to invoke */
+const char *_dtrace_defcpps[] = { "/usr/bin/cpp", "/usr/bin/clang-cpp" }; /* default cpp(1) to invoke */
 const char *_dtrace_defld = "ld";   /* default ld(1) to invoke */
 const char *_dtrace_defobjcopy = "objcopy"; /* default objcopy(1) to invoke */
 #endif
@@ -1195,7 +1195,16 @@ alloc:
 	dtp->dt_provs = calloc(dtp->dt_provbuckets, sizeof (dt_provider_t *));
 	dt_proc_hash_create(dtp);
 	dtp->dt_vmax = DT_VERS_LATEST;
-	dtp->dt_cpp_path = strdup(_dtrace_defcpp);
+	dtp->dt_cpp_path = NULL;
+	for (i = 0; i < (int)sizeof(_dtrace_defcpps) / sizeof(_dtrace_defcpps[0]); ++i) {
+		if (access(_dtrace_defcpps[i], X_OK) == 0) {
+			dtp->dt_cpp_path = strdup(_dtrace_defcpps[i]);
+			break;
+		}
+	}
+	if (dtp->dt_cpp_path == NULL)
+		dtp->dt_cpp_path = strdup("cpp");
+
 	dtp->dt_cpp_argv = malloc(sizeof (char *));
 	dtp->dt_cpp_argc = 1;
 	dtp->dt_cpp_args = 1;



CVS commit: src/lib/libedit

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 19:45:48 UTC 2016

Modified Files:
src/lib/libedit: editline.3

Log Message:
Fix el_{w,}getc documentation (Ingo Schwarze)


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/lib/libedit/editline.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/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.86 src/lib/libedit/editline.3:1.87
--- src/lib/libedit/editline.3:1.86	Wed Feb 24 13:28:54 2016
+++ src/lib/libedit/editline.3	Wed Feb 24 14:45:48 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.86 2016/02/24 18:28:54 christos Exp $
+.\"	$NetBSD: editline.3,v 1.87 2016/02/24 19:45:48 christos Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -173,6 +173,16 @@ library (which needs the
 library).
 Programs should be linked with
 .Fl ledit ltermcap .
+.Pp
+The
+.Nm
+library respects the
+.Dv LC_CTYPE
+locale set by the application program and never uses
+.Xr setlocale 3
+to change the locale.
+The only locales supported are UTF-8 and the default C or POSIX locale.
+If any other locale is set, behaviour is undefined.
 .Sh LINE EDITING FUNCTIONS
 The line editing functions use a common data structure,
 .Fa EditLine ,
@@ -238,14 +248,42 @@ contains the error code that caused it.
 The return value may not remain valid across calls to
 .Fn el_gets
 and must be copied if the data is to be retained.
+.It Fn el_wgetc
+Read a wide character from the tty, respecting the current locale,
+or from the input stream written by
+.Fn el_wpush
+and
+.Fn el_push
+if that is not empty, and store it in
+.Fa ch .
+If an invalid or incomplete character is found, it is discarded,
+.Va errno
+is set to
+.Dv EILSEQ ,
+and the next character is read and stored in
+.Fa ch .
+Returns 1 if a valid character was read, 0 on end of file, or -1 on
+.Xr read 2
+failure.
+In the latter case,
+.Va errno
+is set to indicate the error.
 .It Fn el_getc
-Read a character from the tty.
-.Fa ch
-is modified to contain the character read.
-Returns the number of characters read if successful, \-1 otherwise,
-in which case
-.Dv errno
-can be inspected for the cause.
+Read a wide character as described for
+.Fn el_wgetc
+and return 0 on end of file or -1 on failure.
+If the wide character can be represented as a single-byte character,
+convert it with
+.Xr wctob 3 ,
+store the result in
+.Fa ch ,
+and return 1; otherwise, set
+.Va errno
+to
+.Dv ERANGE
+and return -1.
+In the C or POSIX locale, this simply reads a byte, but for any other
+locale, including UTF-8, this is rarely useful.
 .It Fn el_push
 Pushes
 .Fa str



CVS commit: src/lib/libedit

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 18:28:54 UTC 2016

Modified Files:
src/lib/libedit: editline.3

Log Message:
Fixes from OpenBSD via Ingo Schwarze:
1) Missing comma after tok_str in NAME.
   OpenBSD rev. 1.38 Sep 10, 2015 (schwarze)
2) Style: void in argument list.
   OpenBSD rev. 1.39 Sep 14, 2015 (schwarze)
3) English punctuation: stray comma.
   OpenBSD rev. 1.37 Mar 13, 2015 (jmc)


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/lib/libedit/editline.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/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.85 src/lib/libedit/editline.3:1.86
--- src/lib/libedit/editline.3:1.85	Tue Nov  3 16:36:59 2015
+++ src/lib/libedit/editline.3	Wed Feb 24 13:28:54 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.85 2015/11/03 21:36:59 christos Exp $
+.\"	$NetBSD: editline.3,v 1.86 2016/02/24 18:28:54 christos Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 3, 2015
+.Dd February 24, 2016
 .Dt EDITLINE 3
 .Os
 .Sh NAME
@@ -70,7 +70,7 @@
 .Nm tok_wreset ,
 .Nm tok_line ,
 .Nm tok_wline ,
-.Nm tok_str
+.Nm tok_str ,
 .Nm tok_wstr
 .Nd line editor, history and tokenization functions
 .Sh LIBRARY
@@ -128,9 +128,9 @@
 .Ft void
 .Fn el_wdeletestr "EditLine *e" "int count"
 .Ft History *
-.Fn history_init
+.Fn history_init void
 .Ft HistoryW *
-.Fn history_winit
+.Fn history_winit void
 .Ft void
 .Fn history_end "History *h"
 .Ft void
@@ -744,7 +744,7 @@ to the last new element of the history.
 .It Dv H_ENTER , Fa "const char *str"
 Add
 .Fa str
-as a new element to the history, and, if necessary,
+as a new element to the history and, if necessary,
 removing the oldest entry to keep the list to the created size.
 If
 .Dv H_SETUNIQUE



CVS commit: src/usr.bin/indent

2016-02-24 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Wed Feb 24 17:38:15 UTC 2016

Modified Files:
src/usr.bin/indent: indent.1

Log Message:
Remove double space before [.,:] in macro arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/indent/indent.1

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/indent/indent.1
diff -u src/usr.bin/indent/indent.1:1.24 src/usr.bin/indent/indent.1:1.25
--- src/usr.bin/indent/indent.1:1.24	Wed Feb 24 17:13:48 2016
+++ src/usr.bin/indent/indent.1	Wed Feb 24 17:38:15 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: indent.1,v 1.24 2016/02/24 17:13:48 ginsbach Exp $
+.\"	$NetBSD: indent.1,v 1.25 2016/02/24 17:38:15 ginsbach Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -115,9 +115,9 @@ according to the switches.
 The switches which can be specified are described below.
 They may appear before or after the file names.
 .Pp
-.Sy NOTE  :
+.Sy NOTE :
 If you only specify an
-.Ar input-file  ,
+.Ar input-file ,
 the formatting is
 done `in-place', that is, the formatted file is written back into
 .Ar input-file
@@ -136,7 +136,7 @@ If
 is specified,
 .Nm
 checks to make sure it is different from
-.Ar input-file  .
+.Ar input-file .
 .Pp
 If no
 .Ar input-file
@@ -144,7 +144,7 @@ is specified
 input is read from stdin and the formatted file is written to stdout. 
 .Pp
 The options listed below control the formatting style imposed by
-.Nm  .
+.Nm .
 .Bl -tag -width Op
 .It Fl bacc , nbacc
 If
@@ -154,26 +154,26 @@ compilation block.
 For example, in front of every #ifdef and after every #endif.
 Other blank lines surrounding such blocks will be swallowed.
 Default:
-.Fl nbacc  .
+.Fl nbacc .
 .It Fl bad , nbad
 If
 .Fl bad
 is specified, a blank line is forced after every block of
 declarations.
 Default:
-.Fl nbad  .
+.Fl nbad .
 .It Fl bap , nbap
 If
 .Fl bap
 is specified, a blank line is forced after every procedure body.
 Default:
-.Fl nbap  .
+.Fl nbap .
 .It Fl bbb , nbbb
 If
 .Fl bbb
 is specified, a blank line is forced before every block comment.
 Default:
-.Fl nbbb  .
+.Fl nbbb .
 .It Fl \ , nbc
 If
 .Fl \
@@ -181,7 +181,7 @@ is specified, then a newline is forced a
 .Fl nbc
 turns off this option.
 Default:
-.Fl \  .
+.Fl \ .
 .It Fl \ , \
 Specifying
 .Fl \
@@ -207,11 +207,11 @@ If
 is specified, a blank is forced after
 .Ic sizeof .
 Default:
-.Fl nbs  .
+.Fl nbs .
 .It Fl c Ns Ar n
 The column in which comments on code start.
 Default:
-.Fl c33  .
+.Fl c33 .
 .It Fl cd Ns Ar n
 The column in which comments on declarations start.
 The default
@@ -233,15 +233,15 @@ Rather than like this:
 This only affects block comments, not comments to the right of
 code.
 Default:
-.Fl cdb  .
+.Fl cdb .
 .It Fl ce , nce
 Enables (disables) forcing `else's to cuddle up to the immediately preceding
 `}'.
 Default:
-.Fl \  .
+.Fl \ .
 .It Fl \ Ns Ar n
 Sets the continuation indent to be
-.Ar n  .
+.Ar n .
 Continuation
 lines will be indented that far from the beginning of the first line of the
 statement.
@@ -251,7 +251,7 @@ indicate the nesting, unless
 is in effect.
 .Fl \
 defaults to the same value as
-.Fl i  .
+.Fl i .
 .It Fl cli Ns Ar n
 Causes case labels to be indented
 .Ar n
@@ -261,7 +261,7 @@ statement.
 .Fl cli0.5
 causes case labels to be indented half a tab stop.
 Default:
-.Fl cli0  .
+.Fl cli0 .
 .It Fl d Ns Ar n
 Controls the placement of comments which are not to the right of code.
 For example,
@@ -276,14 +276,14 @@ indentation below.
 Specifies the indentation, in character positions, from a declaration keyword
 to the following identifier.
 Default:
-.Fl di16  .
+.Fl di16 .
 .It Fl dj , ndj
 .Fl \
 left justifies declarations.
 .Fl ndj
 indents declarations the same as code.
 Default:
-.Fl ndj  .
+.Fl ndj .
 .It Fl \ , nei
 Enables (disables) special
 .Ic else-if
@@ -296,7 +296,7 @@ will have the same indentation as the pr
 .Ic \
 statement.
 Default:
-.Fl ei  .
+.Fl ei .
 .It Fl eei , neei
 Enables (disables) extra indentation on continuation lines of
 the expression part of
@@ -306,7 +306,7 @@ and
 statements.
 These continuation lines will be indented one extra level.
 Default:
-.Fl neei  .
+.Fl neei .
 .It Fl fc1 , nfc1
 Enables (disables) the formatting of comments that start in column 1.
 Often, comments whose leading `/' is in column 1 have been carefully
@@ -315,7 +315,7 @@ In such cases,
 .Fl nfc1
 should be used.
 Default:
-.Fl fc1  .
+.Fl fc1 .
 .It Fl i Ns Ar n
 The number of spaces for one indentation level.
 Default:
@@ -324,11 +324,11 @@ Default:
 Enables (disables) the indentation of parameter declarations from the left
 margin.
 Default:
-.Fl \  .
+.Fl \ .
 .It Fl l Ns Ar n
 Maximum length of an output line.
 Default:
-.Fl l78  .
+.Fl l78 .
 .It Fl \ , nlp
 Lines up code surrounded by parenthesis in continuation lines.
 If a line has a 

CVS commit: src/lib/libedit

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 17:20:01 UTC 2016

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

Log Message:
Tuck in mbstate_t to the wide char version only to avoid exposing the zeroing
hack and doing it in the narrow case.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libedit/chartype.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libedit/chartype.h
cvs rdiff -u -r1.84 -r1.85 src/lib/libedit/read.c

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

Modified files:

Index: src/lib/libedit/chartype.c
diff -u src/lib/libedit/chartype.c:1.21 src/lib/libedit/chartype.c:1.22
--- src/lib/libedit/chartype.c:1.21	Wed Feb 24 12:13:22 2016
+++ src/lib/libedit/chartype.c	Wed Feb 24 12:20:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.c,v 1.21 2016/02/24 17:13:22 christos Exp $	*/
+/*	$NetBSD: chartype.c,v 1.22 2016/02/24 17:20:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.21 2016/02/24 17:13:22 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.22 2016/02/24 17:20:01 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -215,12 +215,19 @@ ct_encode_char(char *dst, size_t len, Ch
 	return l;
 }
 
+size_t
+ct_mbrtowc(wchar_t *wc, const char *s, size_t n)
+{
+	mbstate_t mbs;
+	/* This only works because UTF-8 is stateless */
+	memset(, 0, sizeof(mbs));
+	return mbrtowc(wc, s, n, );
+}
+
 #else
 
 size_t
-/*ARGSUSED*/
-ct_mbrtowc(wchar_t *wc, const char *s, size_t n,
-void *mbs __attribute__((__unused__))) {
+ct_mbrtowc(wchar_t *wc, const char *s, size_t n)
 	if (s == NULL)
 		return 0;
 	if (n == 0)

Index: src/lib/libedit/chartype.h
diff -u src/lib/libedit/chartype.h:1.22 src/lib/libedit/chartype.h:1.23
--- src/lib/libedit/chartype.h:1.22	Wed Feb 24 12:13:22 2016
+++ src/lib/libedit/chartype.h	Wed Feb 24 12:20:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.h,v 1.22 2016/02/24 17:13:22 christos Exp $	*/
+/*	$NetBSD: chartype.h,v 1.23 2016/02/24 17:20:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,6 @@
 #define _h_chartype_f
 
 
-
 #ifdef WIDECHAR
 
 /* Ideally we should also test the value of the define to see if it
@@ -60,7 +59,6 @@
 #warning Build environment does not support non-BMP characters
 #endif
 
-#define ct_mbrtowc   mbrtowc
 #define ct_wctob wctob
 #define ct_wctombwctomb
 #define ct_wctomb_reset  wctomb(0,0)
@@ -113,7 +111,6 @@ Width(wchar_t c)
 
 #else /* NARROW */
 
-size_t	ct_mbrtowc(wchar_t *, const char *, size_t, void *);
 #define ct_wctob(w)  ((int)(w))
 #define ct_wctomberror
 #define ct_wctomb_reset
@@ -246,5 +243,7 @@ protected const Char *ct_visual_string(c
 protected int ct_chr_class(Char c);
 #endif
 
+size_t	ct_mbrtowc(wchar_t *, const char *, size_t);
+
 
 #endif /* _chartype_f */

Index: src/lib/libedit/read.c
diff -u src/lib/libedit/read.c:1.84 src/lib/libedit/read.c:1.85
--- src/lib/libedit/read.c:1.84	Wed Feb 24 12:13:22 2016
+++ src/lib/libedit/read.c	Wed Feb 24 12:20:01 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: read.c,v 1.84 2016/02/24 17:13:22 christos Exp $	*/
+/*	$NetBSD: read.c,v 1.85 2016/02/24 17:20:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)read.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: read.c,v 1.84 2016/02/24 17:13:22 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.85 2016/02/24 17:20:01 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -343,12 +343,9 @@ read_char(EditLine *el, wchar_t *cp)
 	}
 
 	for (;;) {
-		mbstate_t mbs;
 
 		++cbp;
-		/* This only works because UTF8 is stateless */
-		memset(, 0, sizeof(mbs));
-		switch (ct_mbrtowc(cp, cbuf, cbp, )) {
+		switch (ct_mbrtowc(cp, cbuf, cbp)) {
 		case (size_t)-1:
 			if (cbp > 1) {
 /*



CVS commit: src/usr.bin/indent

2016-02-24 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Wed Feb 24 17:13:48 UTC 2016

Modified Files:
src/usr.bin/indent: indent.1

Log Message:
Add the [n]ei and [n]eei options to the synopsis; already documented in
description.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/indent/indent.1

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/indent/indent.1
diff -u src/usr.bin/indent/indent.1:1.23 src/usr.bin/indent/indent.1:1.24
--- src/usr.bin/indent/indent.1:1.23	Thu Sep  4 04:06:07 2014
+++ src/usr.bin/indent/indent.1	Wed Feb 24 17:13:48 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: indent.1,v 1.23 2014/09/04 04:06:07 mrg Exp $
+.\"	$NetBSD: indent.1,v 1.24 2016/02/24 17:13:48 ginsbach Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -61,7 +61,7 @@
 .\"
 .\"	from: @(#)indent.1	8.1 (Berkeley) 7/1/93
 .\"
-.Dd September 2, 2014
+.Dd February 24, 2016
 .Dt INDENT 1
 .Os
 .Sh NAME
@@ -85,6 +85,8 @@
 .Op Fl cli Ns Ar n
 .Op Fl d Ns Ar n
 .Op Fl \ Ns Ar n
+.Op Fl ei | Fl nei
+.Op Fl eei | Fl neei
 .Op Fl fc1 | Fl nfc1
 .Op Fl i Ns Ar n
 .Op Fl \ | Fl nip



CVS commit: src/lib/libedit

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 17:13:22 UTC 2016

Modified Files:
src/lib/libedit: chartype.c chartype.h el.c el.h eln.c read.c read.h
readline.c

Log Message:
Make the read_char function always take a wchar_t * argument (Ingo Schwarze)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libedit/chartype.c
cvs rdiff -u -r1.21 -r1.22 src/lib/libedit/chartype.h
cvs rdiff -u -r1.82 -r1.83 src/lib/libedit/el.c
cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/el.h
cvs rdiff -u -r1.26 -r1.27 src/lib/libedit/eln.c
cvs rdiff -u -r1.83 -r1.84 src/lib/libedit/read.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libedit/read.h
cvs rdiff -u -r1.125 -r1.126 src/lib/libedit/readline.c

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

Modified files:

Index: src/lib/libedit/chartype.c
diff -u src/lib/libedit/chartype.c:1.20 src/lib/libedit/chartype.c:1.21
--- src/lib/libedit/chartype.c:1.20	Wed Feb 24 09:25:38 2016
+++ src/lib/libedit/chartype.c	Wed Feb 24 12:13:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.c,v 1.20 2016/02/24 14:25:38 christos Exp $	*/
+/*	$NetBSD: chartype.c,v 1.21 2016/02/24 17:13:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.20 2016/02/24 14:25:38 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.21 2016/02/24 17:13:22 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -219,7 +219,7 @@ ct_encode_char(char *dst, size_t len, Ch
 
 size_t
 /*ARGSUSED*/
-ct_mbrtowc(char *wc, const char *s, size_t n,
+ct_mbrtowc(wchar_t *wc, const char *s, size_t n,
 void *mbs __attribute__((__unused__))) {
 	if (s == NULL)
 		return 0;

Index: src/lib/libedit/chartype.h
diff -u src/lib/libedit/chartype.h:1.21 src/lib/libedit/chartype.h:1.22
--- src/lib/libedit/chartype.h:1.21	Wed Feb 17 14:47:49 2016
+++ src/lib/libedit/chartype.h	Wed Feb 24 12:13:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.h,v 1.21 2016/02/17 19:47:49 christos Exp $	*/
+/*	$NetBSD: chartype.h,v 1.22 2016/02/24 17:13:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -113,7 +113,7 @@ Width(wchar_t c)
 
 #else /* NARROW */
 
-size_t	ct_mbrtowc(char *, const char *, size_t, void *);
+size_t	ct_mbrtowc(wchar_t *, const char *, size_t, void *);
 #define ct_wctob(w)  ((int)(w))
 #define ct_wctomberror
 #define ct_wctomb_reset

Index: src/lib/libedit/el.c
diff -u src/lib/libedit/el.c:1.82 src/lib/libedit/el.c:1.83
--- src/lib/libedit/el.c:1.82	Wed Feb 17 14:47:49 2016
+++ src/lib/libedit/el.c	Wed Feb 24 12:13:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.c,v 1.82 2016/02/17 19:47:49 christos Exp $	*/
+/*	$NetBSD: el.c,v 1.83 2016/02/24 17:13:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)el.c	8.2 (Berkeley) 1/3/94";
 #else
-__RCSID("$NetBSD: el.c,v 1.82 2016/02/17 19:47:49 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.83 2016/02/24 17:13:22 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -308,7 +308,6 @@ FUN(el,set)(EditLine *el, int op, ...)
 	{
 		el_rfunc_t rc = va_arg(ap, el_rfunc_t);
 		rv = el_read_setfn(el, rc);
-		el->el_flags &= ~NARROW_READ;
 		break;
 	}
 

Index: src/lib/libedit/el.h
diff -u src/lib/libedit/el.h:1.33 src/lib/libedit/el.h:1.34
--- src/lib/libedit/el.h:1.33	Wed Feb 17 14:47:49 2016
+++ src/lib/libedit/el.h	Wed Feb 24 12:13:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.h,v 1.33 2016/02/17 19:47:49 christos Exp $	*/
+/*	$NetBSD: el.h,v 1.34 2016/02/24 17:13:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -57,7 +57,6 @@
 #define	UNBUFFERED	0x08
 #define	CHARSET_IS_UTF8 0x10
 #define	NARROW_HISTORY	0x40
-#define	NARROW_READ	0x80
 
 typedef unsigned char el_action_t;	/* Index to command array	*/
 

Index: src/lib/libedit/eln.c
diff -u src/lib/libedit/eln.c:1.26 src/lib/libedit/eln.c:1.27
--- src/lib/libedit/eln.c:1.26	Wed Feb 24 09:25:38 2016
+++ src/lib/libedit/eln.c	Wed Feb 24 12:13:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: eln.c,v 1.26 2016/02/24 14:25:38 christos Exp $	*/
+/*	$NetBSD: eln.c,v 1.27 2016/02/24 17:13:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: eln.c,v 1.26 2016/02/24 14:25:38 christos Exp $");
+__RCSID("$NetBSD: eln.c,v 1.27 2016/02/24 17:13:22 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -247,10 +247,8 @@ el_set(EditLine *el, int op, ...)
 		break;
 	}
 
-	/* XXX: do we need to change el_rfunc_t? */
 	case EL_GETCFN: /* el_rfunc_t */
 		ret = el_wset(el, op, va_arg(ap, el_rfunc_t));
-		el->el_flags |= NARROW_READ;
 		break;
 
 	case EL_CLIENTDATA: /* void * */
@@ -344,7 +342,6 @@ el_get(EditLine *el, int op, ...)
 		

CVS commit: src/doc

2016-02-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Feb 24 16:06:20 UTC 2016

Modified Files:
src/doc: 3RDPARTY

Log Message:
gdb-7.11 is out.


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1307 src/doc/3RDPARTY:1.1308
--- src/doc/3RDPARTY:1.1307	Mon Feb 22 10:10:15 2016
+++ src/doc/3RDPARTY	Wed Feb 24 16:06:20 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1307 2016/02/22 10:10:15 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1308 2016/02/24 16:06:20 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -451,7 +451,7 @@ Before importing a new version of extern
 
 Package:	gdb
 Version:	7.9.1
-Current Vers:	7.10.1
+Current Vers:	7.11
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/gdb/
 Home Page:	http://www.gnu.org/software/gdb/



CVS commit: src/bin/sh

2016-02-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Feb 24 15:28:36 UTC 2016

Modified Files:
src/bin/sh: sh.1

Log Message:
file system police.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.118 src/bin/sh/sh.1:1.119
--- src/bin/sh/sh.1:1.118	Wed Feb 24 14:35:51 2016
+++ src/bin/sh/sh.1	Wed Feb 24 15:28:36 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.118 2016/02/24 14:35:51 christos Exp $
+.\"	$NetBSD: sh.1,v 1.119 2016/02/24 15:28:36 wiz Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -329,9 +329,9 @@ in which case altering the
 .Fl F
 flag has no effect.
 .It Fl h Em trackall
-Bind commands in functions to filesystem paths when the function is defined.
+Bind commands in functions to file system paths when the function is defined.
 When off,
-the filesystem is searched for commands each time the function is invoked.
+the file system is searched for commands each time the function is invoked.
 (Not implemented.)
 .It Fl p Em nopriv
 Do not attempt to reset effective uid if it does not match uid.



CVS commit: src/bin/sh

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 14:51:21 UTC 2016

Added Files:
src/bin/sh: mknodenames.sh

Log Message:
Simple script to create node names for debugging


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/bin/sh/mknodenames.sh

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

Added files:

Index: src/bin/sh/mknodenames.sh
diff -u /dev/null src/bin/sh/mknodenames.sh:1.1
--- /dev/null	Wed Feb 24 09:51:21 2016
+++ src/bin/sh/mknodenames.sh	Wed Feb 24 09:51:20 2016
@@ -0,0 +1,40 @@
+#! /bin/sh
+
+test -t 1 && test "$#" -eq 0 && exec > nodenames.h
+
+echo "#ifdef DEBUG"
+echo '
+/*
+ * Automatically generated by '"$0"'
+ * DO NOT EDIT. Do Not "cvs add".
+ */
+'
+
+MAX=$(awk < nodes.h '
+	/#define/ {
+		if ($3 > MAX) MAX = $3
+	}
+	END { print MAX }
+')
+
+echo
+echo "STATIC const char * const NodeNames[${MAX} + 1] = {"
+
+grep '^#define' nodes.h | sort -k2n | while read define name number opt_comment
+do
+	: ${next:=0}
+	while [ "$number" -gt "$next" ]
+	do
+		echo '	"???",'
+		next=$(( next + 1))
+	done
+	echo '	"'"$name"'",'
+	next=$(( number + 1 ))
+done
+
+echo "};"
+echo
+echo '#define NODETYPENAME(type) \'
+echo '	((unsigned)(type) <= '"${MAX}"' ? NodeNames[(type)] : "??OOR??")'
+echo
+echo '#endif'



CVS commit: src/bin/sh

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 14:57:12 UTC 2016

Modified Files:
src/bin/sh: eval.c

Log Message:
PR/46327: David Mandelberg: Fix exit codes of background jobs (from kre)


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/bin/sh/eval.c

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

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.112 src/bin/sh/eval.c:1.113
--- src/bin/sh/eval.c:1.112	Mon Feb 22 15:03:48 2016
+++ src/bin/sh/eval.c	Wed Feb 24 09:57:12 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.112 2016/02/22 20:03:48 christos Exp $	*/
+/*	$NetBSD: eval.c,v 1.113 2016/02/24 14:57:12 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.112 2016/02/22 20:03:48 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.113 2016/02/24 14:57:12 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -462,8 +462,7 @@ evalsubshell(union node *n, int flags)
 		/* never returns */
 		evaltree(n->nredir.n, flags | EV_EXIT);
 	}
-	if (! backgnd)
-		exitstatus = waitforjob(jp);
+	exitstatus = backgnd ? 0 : waitforjob(jp);
 	INTON;
 }
 
@@ -1084,6 +1083,7 @@ normal_fork:
 	goto out;
 
 parent:	/* parent process gets here (if we forked) */
+	exitstatus = 0;		/* if not altered just below */
 	if (mode == FORK_FG) {	/* argument to fork */
 		exitstatus = waitforjob(jp);
 	} else if (mode == FORK_NOJOB) {



CVS commit: src/tests/bin/sh

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 14:42:50 UTC 2016

Modified Files:
src/tests/bin/sh: t_wait.sh

Log Message:
uncomment clean up


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/bin/sh/t_wait.sh

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

Modified files:

Index: src/tests/bin/sh/t_wait.sh
diff -u src/tests/bin/sh/t_wait.sh:1.4 src/tests/bin/sh/t_wait.sh:1.5
--- src/tests/bin/sh/t_wait.sh:1.4	Wed Feb 24 09:42:06 2016
+++ src/tests/bin/sh/t_wait.sh	Wed Feb 24 09:42:50 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_wait.sh,v 1.4 2016/02/24 14:42:06 christos Exp $
+# $NetBSD: t_wait.sh,v 1.5 2016/02/24 14:42:50 christos Exp $
 #
 # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -89,7 +89,7 @@ EOF
 	wait
 
 	output="$(cat $z | tr '\n' ' ')"
-	# rm -f $s $z
+	rm -f $s $z
 	if [ "$output" != "SIGHUP 129 3 127 " ]; then
 		atf_fail "${output} != 'SIGHUP 129 '"
 	fi



CVS commit: src/tests/bin/sh

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 14:42:06 UTC 2016

Modified Files:
src/tests/bin/sh: t_exit.sh t_wait.sh

Log Message:
Test improvements from kre


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/bin/sh/t_exit.sh \
src/tests/bin/sh/t_wait.sh

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

Modified files:

Index: src/tests/bin/sh/t_exit.sh
diff -u src/tests/bin/sh/t_exit.sh:1.3 src/tests/bin/sh/t_exit.sh:1.4
--- src/tests/bin/sh/t_exit.sh:1.3	Fri Apr 13 02:12:32 2012
+++ src/tests/bin/sh/t_exit.sh	Wed Feb 24 09:42:06 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_exit.sh,v 1.3 2012/04/13 06:12:32 jruoho Exp $
+# $NetBSD: t_exit.sh,v 1.4 2016/02/24 14:42:06 christos Exp $
 #
 # Copyright (c) 2007 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -24,74 +24,139 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 #
+# the implementation of "sh" to test
+: ${TEST_SH:="/bin/sh"}
 
-crud() {
-	test yes = no
-
-	cat helper.sh
-	atf_check -s eq:0 -o match:exiting -e empty /bin/sh helper.sh
-	atf_check -s eq:0 -o match:exiting -e empty /bin/ksh helper.sh
+	echo '( trap "echo exiting" 0; exit; echo NO_NO_NO )' >helper.sh
+	atf_check -s exit:0 -o match:exiting -o not-match:NO_NO -e empty \
+		"${TEST_SH}" helper.sh
+	# test ksh by setting TEST_SH to /bin/ksh and run the entire set...
+	# atf_check -s exit:0 -o match:exiting -e empty /bin/ksh helper.sh
 }
 
+# Is return really defined to operate other than in functions (& '.') ??
 atf_test_case trap_zero__explicit_return
+trap_zero__explicit_return_head() {
+	atf_set "descr" "Tests that the trap statement in a subshell in a " \
+			"script works when the subshell executes a return"
+}
 trap_zero__explicit_return_body() {
-	echo '( trap "echo exiting" 0; return )' >helper.sh
-	atf_check -s eq:0 -o match:exiting -e empty /bin/sh helper.sh
-	atf_check -s eq:0 -o match:exiting -e empty /bin/ksh helper.sh
+	echo '( trap "echo exiting" 0; return; echo NO_NO_NO )' >helper.sh
+	atf_expect_fail "return from a sub-shell not defined and does not work"
+	atf_check -s exit:0 -o match:exiting -o not-match:NO_NO -e empty \
+		"${TEST_SH}" helper.sh
+	# test ksh by setting TEST_SH to /bin/ksh and run the entire set...
+	# atf_check -s exit:0 -o match:exiting -e empty /bin/ksh helper.sh
+}
+
+atf_test_case simple_exit
+simple_exit_head() {
+	atf_set "descr" "Tests that various values for exit status work"
+}
+# Note: ATF will not allow tests of exit values > 255, even if they would work
+simple_exit_body() {
+	for N in 0 1 2 3 4 5 6 42 99 101 125 126 127 128 129 200 254 255
+	do
+		atf_check -s exit:$N -o empty -e empty \
+			"${TEST_SH}" -c "exit $N; echo FOO; echo BAR >&2"
+	done
+}
+
+atf_test_case subshell_exit
+subshell_exit_head() {
+	atf_set "descr" "Tests that subshell exit status works and \$? gets it"
+}
+# Note: ATF will not allow tests of exit values > 255, even if they would work
+subshell_exit_body() {
+	for N in 0 1 2 3 4 5 6 42 99 101 125 126 127 128 129 200 254 255
+	do
+		atf_check -s exit:0 -o empty -e empty \
+			"${TEST_SH}" -c "(exit $N); test \$? -eq $N"
+	done
+}
+
+atf_test_case subshell_background
+subshell_background_head() {
+	atf_set "descr" "Tests that sh(1) sets '$?' properly when running " \
+			"a subshell in the background"
+}
+subshell_background_body() {
+	atf_check -o match:0 -e empty \
+		"${TEST_SH}" -c 'true; (false || true) & echo $?'
+	# atf_expect_fail "PR bin/46327" (now fixed?)
+	atf_check -o match:0 -e empty \
+		"${TEST_SH}" -c 'false; (false || true) & echo $?'
 }
 
 atf_init_test_cases() {
@@ -102,4 +167,7 @@ atf_init_test_cases() {
 	atf_add_test_case trap_zero__implicit_exit
 	atf_add_test_case trap_zero__explicit_exit
 	atf_add_test_case trap_zero__explicit_return
+	atf_add_test_case simple_exit
+	atf_add_test_case subshell_exit
+	atf_add_test_case subshell_background
 }
Index: src/tests/bin/sh/t_wait.sh
diff -u src/tests/bin/sh/t_wait.sh:1.3 src/tests/bin/sh/t_wait.sh:1.4
--- src/tests/bin/sh/t_wait.sh:1.3	Wed Sep 30 02:08:36 2015
+++ src/tests/bin/sh/t_wait.sh	Wed Feb 24 09:42:06 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_wait.sh,v 1.3 2015/09/30 06:08:36 ozaki-r Exp $
+# $NetBSD: t_wait.sh,v 1.4 2016/02/24 14:42:06 

CVS commit: src/bin/sh

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 14:38:40 UTC 2016

Modified Files:
src/bin/sh: options.c

Log Message:
If we don't have shared address space vfork fail back to using fork since
we are depending on the shared address space feature (from kre)


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/bin/sh/options.c

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

Modified files:

Index: src/bin/sh/options.c
diff -u src/bin/sh/options.c:1.43 src/bin/sh/options.c:1.44
--- src/bin/sh/options.c:1.43	Tue Mar 20 14:42:29 2012
+++ src/bin/sh/options.c	Wed Feb 24 09:38:40 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.43 2012/03/20 18:42:29 matt Exp $	*/
+/*	$NetBSD: options.c,v 1.44 2016/02/24 14:38:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)options.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: options.c,v 1.43 2012/03/20 18:42:29 matt Exp $");
+__RCSID("$NetBSD: options.c,v 1.44 2016/02/24 14:38:40 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -103,6 +103,10 @@ procargs(int argc, char **argv)
 		iflag = 2;
 	if (mflag == 2)
 		mflag = iflag;
+#ifndef DO_SHAREDVFORK
+	if (usefork == 2)
+		usefork = 1;
+#endif
 	for (i = 0; i < NOPTS; i++)
 		if (optlist[i].val == 2)
 			optlist[i].val = 0;



CVS commit: src/bin/sh

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 14:35:51 UTC 2016

Modified Files:
src/bin/sh: sh.1

Log Message:
Make sh.1 catch up with reality. Document -h (such as it is...)
and also added doc for some other stuff that was missing.

Take the opportunity to clean up the way the flags are set in the
man page, so every new flag doesn't have to be added 6 times!
(Some of the lists were different from others, in ordering, and
content, for no good reason at all.)

Make a few other cleanups ... Add text about AND-OR lists,
This can be also used to justify closing an open PR:
(that "sh -c 'command &&'" is not a syntax error...).

Add doc for -F, which should default to set if the shell somehow
gets compiled without DO_SHAREDVFORK defined, (to be committed
separately)

XXX: Consider disabling DO_SHAREDVFORK if SMALL is defined?

>From kre


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.117 src/bin/sh/sh.1:1.118
--- src/bin/sh/sh.1:1.117	Tue Jan  5 19:22:21 2016
+++ src/bin/sh/sh.1	Wed Feb 24 09:35:51 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.117 2016/01/06 00:22:21 wiz Exp $
+.\"	$NetBSD: sh.1,v 1.118 2016/02/24 14:35:51 christos Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -33,6 +33,7 @@
 .\"
 .Dd January 5, 2015
 .Dt SH 1
+.ds flags abCEeFfhnuvxIimpqV
 .Os
 .Sh NAME
 .Nm sh
@@ -40,8 +41,8 @@
 .Sh SYNOPSIS
 .Nm
 .Bk -words
-.Op Fl aCefnuvxIimqVEb
-.Op Cm +aCefnuvxIimqVEb
+.Op Fl \*[flags]
+.Op Cm +\*[flags]
 .Ek
 .Bk -words
 .Op Fl o Ar option_name
@@ -53,8 +54,8 @@
 .Nm
 .Fl c
 .Bk -words
-.Op Fl abCEefnuvxIimpqV
-.Op Cm +abCEefnuvxIimpqV
+.Op Fl \*[flags]
+.Op Cm +\*[flags]
 .Ek
 .Bk -words
 .Op Fl o Ar option_name
@@ -67,8 +68,8 @@
 .Nm
 .Fl s
 .Bk -words
-.Op Fl abCEefnuvxIimpqV
-.Op Cm +abCEefnuvxIimpqV
+.Op Fl \*[flags]
+.Op Cm +\*[flags]
 .Ek
 .Bk -words
 .Op Fl o Ar option_name
@@ -222,6 +223,11 @@ Special parameter 0 will be set from the
 .Ar command_name
 operand and the positional parameters ($1, $2, etc.)
 set from the remaining argument operands.
+.Fl c
+is only available at invocation, it cannot be
+.Ic set ,
+and there is no form using
+.Dq \&+ .
 .It Fl C Em noclobber
 Don't overwrite existing files with
 .Dq \*[Gt] .
@@ -238,7 +244,15 @@ or if the command is the left hand opera
 .Dq \*[Am]\*[Am]
 or
 .Dq ||
+operator,
+or if it is a pipeline (or simple command) preceded by the
+.Dq \&!
 operator.
+With pipelines, only the status of the entire pipeline
+(indicated by the last command it contains)
+is tested when
+.Fl e
+is set to determine if the shell should exit.
 .It Fl f Em noglob
 Disable pathname expansion.
 .It Fl n Em noexec
@@ -276,7 +290,7 @@ Turn on job control (set automatically w
 .It Fl s Em stdin
 Read commands from standard input (set automatically if no file arguments
 are present).
-This option has no effect when set after the shell has
+This option has no effect when set or reset after the shell has
 already started running (i.e. with
 .Ic set ) .
 .It Fl V Em vi
@@ -299,6 +313,26 @@ section below.)
 .It Fl b Em notify
 Enable asynchronous notification of background job completion.
 (Not implemented.)
+.It Fl F Em fork
+Cause the shell to always use
+.Xr fork 2
+instead of attempting
+.Xr vfork 2
+when it needs to create a new process.
+This should normally have no visible effect,
+but can slow execution.
+The
+.Nm
+can be compiled to always use
+.Xr fork 2
+in which case altering the
+.Fl F
+flag has no effect.
+.It Fl h Em trackall
+Bind commands in functions to filesystem paths when the function is defined.
+When off,
+the filesystem is searched for commands each time the function is invoked.
+(Not implemented.)
 .It Fl p Em nopriv
 Do not attempt to reset effective uid if it does not match uid.
 This is not set by default to help avoid incorrect usage by setuid
@@ -311,6 +345,13 @@ Make an interactive shell always print t
 changed by the
 .Ic cd
 command.
+.It "\ \ " Em nolog
+Prevent the entry of function definitions into the command history (see
+.Ic fc
+in the
+.Sx Built-ins
+section.)
+(Not implemented.)
 .It "\ \ " Em tabcomplete
 Enables filename completion in the command line editor.
 Typing a tab character will extend the current input word to match a
@@ -688,6 +729,11 @@ This is not the way it works in C.
 Also, if you forget the left-hand side (for example when continuing lines but
 forgetting to use a backslash) it defaults to a true statement.
 This behavior is not useful and should not be relied upon.
+Similarly, if input to the
+.Nm
+reaches end of file immediately after one of these operators,
+it is assumed that a true statement follows.
+This behavior is also not useful and should not be relied upon.
 .Ss Flow-Control Constructs -- if, while, 

CVS commit: src/lib/libedit

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 14:29:21 UTC 2016

Modified Files:
src/lib/libedit: chared.c

Log Message:
A very simple, non-intrusive patch to fix a segfault (and a
functional error) in c_gets(), file chared.c.

Run any program using libedit in the default way.  At the el_[w]gets()
prompt, invoke ed-command (for example, in emacs mode, press the
escape key, then type the letter 'x').  You should see a ": " prompt.
Type the letter 'x' again.  Now press the backspace key a few times,
looking at the screen after each key press:

 - The 1st BS deletes the 'x'.
 - The 2nd BS deletes the blank after the prompt.
 - The 3rd BS deletes the colon of the prompt.
 - The 4th BS moves the cursor up one line.
 - The 5th BS gives me "Segmentation fault (core dumped)".

Depending on your platform, it might take a few more or a few less
backspaces for the buffer underrun to trigger the segfault, but
you should be able to hit it sooner or later no matter what.

Run the same program again, connect again and invoke ed-command again.
Now type: 'b', backspace, 'i', backspace, 'n', backspace, 'd', enter.
The "bind" command gets executed, even though you deleted what you
typed before hitting enter.

>From Ingo Schwatze.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/lib/libedit/chared.c

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

Modified files:

Index: src/lib/libedit/chared.c
diff -u src/lib/libedit/chared.c:1.48 src/lib/libedit/chared.c:1.49
--- src/lib/libedit/chared.c:1.48	Wed Feb 24 09:25:38 2016
+++ src/lib/libedit/chared.c	Wed Feb 24 09:29:21 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: chared.c,v 1.48 2016/02/24 14:25:38 christos Exp $	*/
+/*	$NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)chared.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: chared.c,v 1.48 2016/02/24 14:25:38 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -707,6 +707,7 @@ c_gets(EditLine *el, Char *buf, const Ch
 len = -1;
 break;
 			}
+			len--;
 			cp--;
 			continue;
 



CVS commit: src/lib/libedit

2016-02-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 24 14:25:38 UTC 2016

Modified Files:
src/lib/libedit: Makefile chared.c chartype.c common.c eln.c keymacro.c
read.c search.c

Log Message:
Get split el_getc and el_wgetc completely and call el_wgetc internally.
Change some character constants to they wide versions. (Ingo Schwarze)


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/lib/libedit/Makefile
cvs rdiff -u -r1.47 -r1.48 src/lib/libedit/chared.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libedit/chartype.c
cvs rdiff -u -r1.38 -r1.39 src/lib/libedit/common.c src/lib/libedit/search.c
cvs rdiff -u -r1.25 -r1.26 src/lib/libedit/eln.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libedit/keymacro.c
cvs rdiff -u -r1.82 -r1.83 src/lib/libedit/read.c

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

Modified files:

Index: src/lib/libedit/Makefile
diff -u src/lib/libedit/Makefile:1.54 src/lib/libedit/Makefile:1.55
--- src/lib/libedit/Makefile:1.54	Wed Feb 17 14:47:49 2016
+++ src/lib/libedit/Makefile	Wed Feb 24 09:25:38 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.54 2016/02/17 19:47:49 christos Exp $
+#	$NetBSD: Makefile,v 1.55 2016/02/24 14:25:38 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
 
 USE_SHLIBDIR=	yes
@@ -15,7 +15,7 @@ COPTS+=	-Wunused-parameter
 CWARNFLAGS.gcc+=	-Wconversion
 CWARNFLAGS.clang+=	-Wno-cast-qual
 
-OSRCS=	chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \
+OSRCS=	chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \
 	hist.c keymacro.c map.c chartype.c \
 	parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c
 
@@ -37,7 +37,6 @@ MLINKS=	editline.3 el_init.3 editline.3 
 SRCS=	editline.c readline.c tokenizer.c history.c
 
 .if ${WIDECHAR} == "yes"
-OSRCS += eln.c
 SRCS += tokenizern.c historyn.c
 CLEANFILES+=tokenizern.c.tmp tokenizern.c historyn.c.tmp historyn.c
 CPPFLAGS+=-DWIDECHAR

Index: src/lib/libedit/chared.c
diff -u src/lib/libedit/chared.c:1.47 src/lib/libedit/chared.c:1.48
--- src/lib/libedit/chared.c:1.47	Wed Feb 17 14:47:49 2016
+++ src/lib/libedit/chared.c	Wed Feb 24 09:25:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: chared.c,v 1.47 2016/02/17 19:47:49 christos Exp $	*/
+/*	$NetBSD: chared.c,v 1.48 2016/02/24 14:25:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)chared.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: chared.c,v 1.47 2016/02/17 19:47:49 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.48 2016/02/24 14:25:38 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -675,9 +675,9 @@ out:
 protected int
 c_gets(EditLine *el, Char *buf, const Char *prompt)
 {
-	Char ch;
+	wchar_t wch;
 	ssize_t len;
-	Char *cp = el->el_line.buffer;
+	Char *cp = el->el_line.buffer, ch;
 
 	if (prompt) {
 		len = (ssize_t)Strlen(prompt);
@@ -692,15 +692,16 @@ c_gets(EditLine *el, Char *buf, const Ch
 		el->el_line.lastchar = cp + 1;
 		re_refresh(el);
 
-		if (FUN(el,getc)(el, ) != 1) {
+		if (el_wgetc(el, ) != 1) {
 			ed_end_of_file(el, 0);
 			len = -1;
 			break;
 		}
+		ch = (Char)wch;
 
 		switch (ch) {
 
-		case 0010:	/* Delete and backspace */
+		case L'\b':	/* Delete and backspace */
 		case 0177:
 			if (len == 0) {
 len = -1;
@@ -710,8 +711,8 @@ c_gets(EditLine *el, Char *buf, const Ch
 			continue;
 
 		case 0033:	/* ESC */
-		case '\r':	/* Newline */
-		case '\n':
+		case L'\r':	/* Newline */
+		case L'\n':
 			buf[len] = ch;
 			break;
 

Index: src/lib/libedit/chartype.c
diff -u src/lib/libedit/chartype.c:1.19 src/lib/libedit/chartype.c:1.20
--- src/lib/libedit/chartype.c:1.19	Wed Feb 17 14:47:49 2016
+++ src/lib/libedit/chartype.c	Wed Feb 24 09:25:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.c,v 1.19 2016/02/17 19:47:49 christos Exp $	*/
+/*	$NetBSD: chartype.c,v 1.20 2016/02/24 14:25:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.19 2016/02/17 19:47:49 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.20 2016/02/24 14:25:38 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -218,8 +218,9 @@ ct_encode_char(char *dst, size_t len, Ch
 #else
 
 size_t
+/*ARGSUSED*/
 ct_mbrtowc(char *wc, const char *s, size_t n,
-void *mbs __attribute((__unused__))) {
+void *mbs __attribute__((__unused__))) {
 	if (s == NULL)
 		return 0;
 	if (n == 0)

Index: src/lib/libedit/common.c
diff -u src/lib/libedit/common.c:1.38 src/lib/libedit/common.c:1.39
--- src/lib/libedit/common.c:1.38	Wed Feb 17 14:47:49 2016
+++ src/lib/libedit/common.c	Wed Feb 24 09:25:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.c,v 1.38 2016/02/17 19:47:49 christos Exp $	*/
+/*	$NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char 

CVS commit: src/usr.bin/infocmp

2016-02-24 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Feb 24 13:31:54 UTC 2016

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

Log Message:
White space police.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/infocmp/infocmp.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/infocmp/infocmp.c
diff -u src/usr.bin/infocmp/infocmp.c:1.8 src/usr.bin/infocmp/infocmp.c:1.9
--- src/usr.bin/infocmp/infocmp.c:1.8	Tue Oct  1 09:01:49 2013
+++ src/usr.bin/infocmp/infocmp.c	Wed Feb 24 13:31:54 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: infocmp.c,v 1.8 2013/10/01 09:01:49 roy Exp $ */
+/* $NetBSD: infocmp.c,v 1.9 2016/02/24 13:31:54 roy Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: infocmp.c,v 1.8 2013/10/01 09:01:49 roy Exp $");
+__RCSID("$NetBSD: infocmp.c,v 1.9 2016/02/24 13:31:54 roy Exp $");
 
 #include 
 
@@ -102,7 +102,7 @@ outstr(FILE *f, const char *str)
 			}
 			goto prnt;
 		}
-		
+
 		if (f != NULL)
 			fputc('\\', f);
 		r++;
@@ -142,11 +142,11 @@ static void
 print_ent(const TIENT *ents, size_t nents)
 {
 	size_t col, i, l;
-	char nbuf[64];	
+	char nbuf[64];
 
 	if (nents == 0)
 		return;
-	
+
 	col = SW;
 	printf("\t");
 	for (i = 0; i < nents; i++) {
@@ -230,7 +230,7 @@ load_ents(TIENT *ents, TERMINAL *t, char
 	default:
 		max = TISTRMAX;
 	}
-	
+
 	n = 0;
 	for (i = 0; i <= max; i++) {
 		switch (type) {
@@ -263,7 +263,7 @@ load_ents(TIENT *ents, TERMINAL *t, char
 			break;
 		}
 	}
-	
+
 	if (xflag != 0 && t->_nuserdefs != 0) {
 		for (i = 0; i < t->_nuserdefs; i++) {
 			ud = >_userdefs[i];
@@ -293,7 +293,7 @@ load_ents(TIENT *ents, TERMINAL *t, char
 			}
 		}
 	}
-	
+
 	qsort(ents, n, sizeof(TIENT), ent_compare);
 	return n;
 }
@@ -308,7 +308,7 @@ cprint_ent(TIENT *ent)
 		else
 			printf("-");
 	}
-	
+
 	switch (ent->type) {
 	case 'f':
 		if (VALID_BOOLEAN(ent->flag))
@@ -351,7 +351,7 @@ compare_ents(TIENT *ents1, size_t n1, TI
 	size_t i1, i2;
 	TIENT *e1, *e2, ee;
 	int c;
-	
+
 	i1 = i2 = 0;
 	ee.type = 'f';
 	ee.flag = ABSENT_BOOLEAN;
@@ -452,7 +452,7 @@ show_missing(TERMINAL *t1, TERMINAL *t2,
 {
 	ssize_t i, max;
 	const char *id;
-	
+
 	switch (type) {
 	case 'f':
 		max = TIFLAGMAX;
@@ -518,7 +518,7 @@ use_terms(TERMINAL *term, size_t nuse, c
 errx(1, "cannot use same terminal");
 		terms[i] = load_term(*uterms++);
 	}
-	
+
 	for (i = 0; i < TIFLAGMAX + 1; i++) {
 		agree = absent = data = 0;
 		for (j = 0; j < nuse; j++) {
@@ -538,7 +538,7 @@ use_terms(TERMINAL *term, size_t nuse, c
 		else if (term->flags[i] == ABSENT_BOOLEAN)
 			term->flags[i] = CANCELLED_BOOLEAN;
 	}
-	
+
 	for (i = 0; i < TINUMMAX + 1; i++) {
 		agree = absent = data = 0;
 		for (j = 0; j < nuse; j++) {
@@ -558,7 +558,7 @@ use_terms(TERMINAL *term, size_t nuse, c
 		else if (term->nums[i] == ABSENT_NUMERIC)
 			term->nums[i] = CANCELLED_NUMERIC;
 	}
-	
+
 	for (i = 0; i < TISTRMAX + 1; i++) {
 		agree = absent = data = 0;
 		for (j = 0; j < nuse; j++) {



CVS commit: src/usr.bin/tic

2016-02-24 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Feb 24 12:01:44 UTC 2016

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

Log Message:
White space police.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/tic/tic.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/tic/tic.c
diff -u src/usr.bin/tic/tic.c:1.24 src/usr.bin/tic/tic.c:1.25
--- src/usr.bin/tic/tic.c:1.24	Sun Jul 20 20:20:16 2014
+++ src/usr.bin/tic/tic.c	Wed Feb 24 12:01:44 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: tic.c,v 1.24 2014/07/20 20:20:16 christos Exp $ */
+/* $NetBSD: tic.c,v 1.25 2016/02/24 12:01:44 roy Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: tic.c,v 1.24 2014/07/20 20:20:16 christos Exp $");
+__RCSID("$NetBSD: tic.c,v 1.25 2016/02/24 12:01:44 roy Exp $");
 
 #include 
 #include 
@@ -164,7 +164,7 @@ process_entry(TBUF *buf, int flags)
 	char *p, *e, *alias;
 	TERM *term;
 	TIC *tic;
-	
+
 	if (buf->bufpos == 0)
 		return 0;
 	/* Terminate the string */
@@ -204,7 +204,7 @@ process_entry(TBUF *buf, int flags)
 		}
 		free(alias);
 	}
-	
+
 	return 0;
 }
 
@@ -419,7 +419,7 @@ print_dump(int argc, char **argv)
 printf("\t\t\"");
 col = 16;
 			}
-			
+
 			col += printf("\\%03o", (uint8_t)buf[j]);
 			if (col > 75) {
 printf("\"%s\n",
@@ -542,7 +542,7 @@ main(int argc, char **argv)
 		*/
 		if (!isspace((unsigned char)*buf) && tbuf.bufpos != 0)
 			process_entry(, flags);
-		
+
 		/* Grow the buffer if needed */
 		grow_tbuf(, len);
 		/* Append the string */
@@ -588,6 +588,5 @@ main(int argc, char **argv)
 	hdestroy1(free, NULL);
 #endif
 
-
 	return EXIT_SUCCESS;
 }



CVS commit: [nick-nhusb] src/sys/dev/usb

2016-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 24 09:06:04 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: ohci.c

Log Message:
Move a comment to its own line.


To generate a diff of this commit:
cvs rdiff -u -r1.254.2.47 -r1.254.2.48 src/sys/dev/usb/ohci.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/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.254.2.47 src/sys/dev/usb/ohci.c:1.254.2.48
--- src/sys/dev/usb/ohci.c:1.254.2.47	Wed Feb 24 09:00:59 2016
+++ src/sys/dev/usb/ohci.c	Wed Feb 24 09:06:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.254.2.47 2016/02/24 09:00:59 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.254.2.48 2016/02/24 09:06:04 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.47 2016/02/24 09:00:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.48 2016/02/24 09:06:04 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -3725,7 +3725,8 @@ ohci_device_isoc_enter(struct usbd_xfer 
 	isoc->next = isoc->next + ncur;
 	isoc->inuse += nframes;
 
-	xfer->ux_actlen = offs;	/* XXX pretend we did it all */
+	/* XXX pretend we did it all */
+	xfer->ux_actlen = offs;
 
 	xfer->ux_status = USBD_IN_PROGRESS;
 



CVS commit: [nick-nhusb] src/sys/dev/usb

2016-02-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 24 09:00:59 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: ohci.c

Log Message:
Debug improvements


To generate a diff of this commit:
cvs rdiff -u -r1.254.2.46 -r1.254.2.47 src/sys/dev/usb/ohci.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/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.254.2.46 src/sys/dev/usb/ohci.c:1.254.2.47
--- src/sys/dev/usb/ohci.c:1.254.2.46	Fri Feb 19 08:22:40 2016
+++ src/sys/dev/usb/ohci.c	Wed Feb 24 09:00:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.254.2.46 2016/02/19 08:22:40 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.254.2.47 2016/02/24 09:00:59 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.46 2016/02/19 08:22:40 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.47 2016/02/24 09:00:59 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1369,10 +1369,12 @@ ohci_intr1(ohci_softc_t *sc)
 		usb_schedsoftintr(>sc_bus);
 	}
 	if (eintrs & OHCI_RD) {
+		DPRINTFN(5, "resume detect", sc, 0, 0, 0);
 		printf("%s: resume detect\n", device_xname(sc->sc_dev));
 		/* XXX process resume detect */
 	}
 	if (eintrs & OHCI_UE) {
+		DPRINTFN(5, "unrecoverable error", sc, 0, 0, 0);
 		printf("%s: unrecoverable error, controller halted\n",
 		   device_xname(sc->sc_dev));
 		OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
@@ -2077,7 +2079,7 @@ ohci_dump_td(ohci_softc_t *sc, ohci_soft
 	__SHIFTOUT(flags, OHCI_TD_TOGGLE_MASK));
 	DPRINTF("EC=%d CC=%d", OHCI_TD_GET_EC(flags), OHCI_TD_GET_CC(flags),
 	0, 0);
-	DPRINTF("cbp=0x%08lx nexttd=0x%08lx be=0x%08lx",
+	DPRINTF("td_cbp=0x%08lx td_nexttd=0x%08lx td_be=0x%08lx",
 	   (u_long)O32TOH(std->td.td_cbp),
 	   (u_long)O32TOH(std->td.td_nexttd),
 	   (u_long)O32TOH(std->td.td_be), 0);



CVS commit: src/usr.sbin/arp

2016-02-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Feb 24 08:01:09 UTC 2016

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

Log Message:
Kill confusable use of SIN_PROXY


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.sbin/arp/arp.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/arp/arp.c
diff -u src/usr.sbin/arp/arp.c:1.53 src/usr.sbin/arp/arp.c:1.54
--- src/usr.sbin/arp/arp.c:1.53	Fri Jul 31 04:02:40 2015
+++ src/usr.sbin/arp/arp.c	Wed Feb 24 08:01:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: arp.c,v 1.53 2015/07/31 04:02:40 ozaki-r Exp $ */
+/*	$NetBSD: arp.c,v 1.54 2016/02/24 08:01:09 ozaki-r Exp $ */
 
 /*
  * Copyright (c) 1984, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1984, 19
 #if 0
 static char sccsid[] = "@(#)arp.c	8.3 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: arp.c,v 1.53 2015/07/31 04:02:40 ozaki-r Exp $");
+__RCSID("$NetBSD: arp.c,v 1.54 2016/02/24 08:01:09 ozaki-r Exp $");
 #endif
 #endif /* not lint */
 
@@ -289,7 +289,7 @@ set(int argc, char **argv)
 		}
 		else if (strncmp(argv[0], "pub", 3) == 0) {
 			flags |= RTF_ANNOUNCE;
-			doing_proxy = SIN_PROXY;
+			doing_proxy = 1;
 			if (argc && strncmp(argv[1], "pro", 3) == 0) {
 			export_only = 1;
 			argc--; argv++;