svn commit: r188181 - in user/thompsa/usb: . bin/pax contrib/wpa_supplicant etc etc/defaults etc/rc.d lib/libarchive lib/libc/sparc64/sys lib/libc/string lib/libc/sys lib/libusbhid sbin/fsck_ffs sb...

Andrew Thompson thompsa at FreeBSD.org
Thu Feb 5 12:13:55 PST 2009


Author: thompsa
Date: Thu Feb  5 20:13:51 2009
New Revision: 188181
URL: http://svn.freebsd.org/changeset/base/188181

Log:
  MFH r187971-188180

Added:
  user/thompsa/usb/lib/libusbhid/descr_compat.c
     - copied unchanged from r188180, head/lib/libusbhid/descr_compat.c
  user/thompsa/usb/sbin/ipfw/altq.c
     - copied unchanged from r188180, head/sbin/ipfw/altq.c
  user/thompsa/usb/sys/dev/cfi/cfi_bus_ixp4xx.c
     - copied unchanged from r188180, head/sys/dev/cfi/cfi_bus_ixp4xx.c
  user/thompsa/usb/tools/tools/cfi/
     - copied from r188180, head/tools/tools/cfi/
Modified:
  user/thompsa/usb/   (props changed)
  user/thompsa/usb/ObsoleteFiles.inc
  user/thompsa/usb/UPDATING
  user/thompsa/usb/bin/pax/file_subs.c
  user/thompsa/usb/contrib/wpa_supplicant/   (props changed)
  user/thompsa/usb/etc/defaults/rc.conf
  user/thompsa/usb/etc/network.subr
  user/thompsa/usb/etc/rc.d/defaultroute
  user/thompsa/usb/lib/libarchive/archive_read_support_format_ar.c
  user/thompsa/usb/lib/libc/sparc64/sys/__sparc_utrap.c
  user/thompsa/usb/lib/libc/string/memccpy.c
  user/thompsa/usb/lib/libc/string/memchr.c
  user/thompsa/usb/lib/libc/string/memcmp.c
  user/thompsa/usb/lib/libc/string/memmem.c
  user/thompsa/usb/lib/libc/string/strcasecmp.c
  user/thompsa/usb/lib/libc/string/strcasestr.c
  user/thompsa/usb/lib/libc/string/strcmp.c
  user/thompsa/usb/lib/libc/string/strcoll.c
  user/thompsa/usb/lib/libc/string/strdup.c
  user/thompsa/usb/lib/libc/string/strmode.c
  user/thompsa/usb/lib/libc/string/strncmp.c
  user/thompsa/usb/lib/libc/string/strncpy.c
  user/thompsa/usb/lib/libc/string/strnstr.c
  user/thompsa/usb/lib/libc/string/strpbrk.c
  user/thompsa/usb/lib/libc/string/strsep.c
  user/thompsa/usb/lib/libc/string/strstr.c
  user/thompsa/usb/lib/libc/string/wcscat.c
  user/thompsa/usb/lib/libc/string/wcscmp.c
  user/thompsa/usb/lib/libc/string/wcscpy.c
  user/thompsa/usb/lib/libc/string/wcscspn.c
  user/thompsa/usb/lib/libc/string/wcslcat.c
  user/thompsa/usb/lib/libc/string/wcslcpy.c
  user/thompsa/usb/lib/libc/string/wcslen.c
  user/thompsa/usb/lib/libc/string/wcsncat.c
  user/thompsa/usb/lib/libc/string/wcsncmp.c
  user/thompsa/usb/lib/libc/string/wcspbrk.c
  user/thompsa/usb/lib/libc/string/wcsspn.c
  user/thompsa/usb/lib/libc/string/wcsstr.c
  user/thompsa/usb/lib/libc/string/wmemchr.c
  user/thompsa/usb/lib/libc/string/wmemcmp.c
  user/thompsa/usb/lib/libc/string/wmemcpy.c
  user/thompsa/usb/lib/libc/string/wmemmove.c
  user/thompsa/usb/lib/libc/string/wmemset.c
  user/thompsa/usb/lib/libc/sys/send.2
  user/thompsa/usb/lib/libusbhid/Makefile
  user/thompsa/usb/lib/libusbhid/descr.c
  user/thompsa/usb/lib/libusbhid/usbhid.3
  user/thompsa/usb/lib/libusbhid/usbhid.h
  user/thompsa/usb/lib/libusbhid/usbvar.h
  user/thompsa/usb/sbin/fsck_ffs/fsck.h
  user/thompsa/usb/sbin/fsck_ffs/fsck_ffs.8
  user/thompsa/usb/sbin/fsck_ffs/fsutil.c
  user/thompsa/usb/sbin/fsck_ffs/inode.c
  user/thompsa/usb/sbin/fsck_ffs/main.c
  user/thompsa/usb/sbin/fsck_ffs/pass1.c
  user/thompsa/usb/sbin/geom/core/geom.c
  user/thompsa/usb/sbin/ifconfig/ifieee80211.c
  user/thompsa/usb/sbin/ifconfig/regdomain.c
  user/thompsa/usb/sbin/ifconfig/regdomain.h
  user/thompsa/usb/sbin/ipfw/Makefile
  user/thompsa/usb/sbin/ipfw/dummynet.c
  user/thompsa/usb/sbin/ipfw/ipfw2.c
  user/thompsa/usb/sbin/ipfw/ipfw2.h
  user/thompsa/usb/sbin/ipfw/nat.c
  user/thompsa/usb/share/man/man9/lock.9
  user/thompsa/usb/sys/   (props changed)
  user/thompsa/usb/sys/amd64/amd64/exception.S
  user/thompsa/usb/sys/amd64/amd64/machdep.c
  user/thompsa/usb/sys/amd64/amd64/mp_machdep.c
  user/thompsa/usb/sys/amd64/include/intr_machdep.h
  user/thompsa/usb/sys/arm/arm/busdma_machdep.c
  user/thompsa/usb/sys/arm/arm/cpufunc_asm_sheeva.S   (props changed)
  user/thompsa/usb/sys/arm/arm/dump_machdep.c
  user/thompsa/usb/sys/arm/arm/elf_trampoline.c
  user/thompsa/usb/sys/arm/arm/pmap.c
  user/thompsa/usb/sys/arm/arm/vm_machdep.c
  user/thompsa/usb/sys/arm/conf/AVILA
  user/thompsa/usb/sys/arm/conf/AVILA.hints
  user/thompsa/usb/sys/arm/include/atomic.h
  user/thompsa/usb/sys/arm/sa11x0/assabet_machdep.c
  user/thompsa/usb/sys/arm/xscale/ixp425/avila_machdep.c
  user/thompsa/usb/sys/arm/xscale/ixp425/files.ixp425
  user/thompsa/usb/sys/arm/xscale/ixp425/ixp425.c
  user/thompsa/usb/sys/arm/xscale/ixp425/ixp425reg.h
  user/thompsa/usb/sys/conf/options
  user/thompsa/usb/sys/contrib/pf/   (props changed)
  user/thompsa/usb/sys/crypto/via/padlock.c
  user/thompsa/usb/sys/dev/acpi_support/acpi_panasonic.c
  user/thompsa/usb/sys/dev/acpica/acpi_pcib_acpi.c
  user/thompsa/usb/sys/dev/ae/if_ae.c
  user/thompsa/usb/sys/dev/an/if_an.c
  user/thompsa/usb/sys/dev/an/if_anreg.h
  user/thompsa/usb/sys/dev/ata/ata-disk.c
  user/thompsa/usb/sys/dev/ata/atapi-cam.c
  user/thompsa/usb/sys/dev/ata/atapi-cd.c
  user/thompsa/usb/sys/dev/ata/atapi-fd.c
  user/thompsa/usb/sys/dev/ata/atapi-tape.c
  user/thompsa/usb/sys/dev/ath/ath_hal/ah_regdomain.c
  user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212.h
  user/thompsa/usb/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c
  user/thompsa/usb/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
  user/thompsa/usb/sys/dev/atkbdc/atkbdc_isa.c
  user/thompsa/usb/sys/dev/bge/if_bge.c
  user/thompsa/usb/sys/dev/bm/if_bm.c
  user/thompsa/usb/sys/dev/cardbus/cardbus.c
  user/thompsa/usb/sys/dev/cfi/cfi_core.c
  user/thompsa/usb/sys/dev/cfi/cfi_dev.c
  user/thompsa/usb/sys/dev/cfi/cfi_reg.h
  user/thompsa/usb/sys/dev/cfi/cfi_var.h
  user/thompsa/usb/sys/dev/exca/exca.c
  user/thompsa/usb/sys/dev/firewire/firewire.c
  user/thompsa/usb/sys/dev/firewire/fwohci.c
  user/thompsa/usb/sys/dev/firewire/fwohci_pci.c
  user/thompsa/usb/sys/dev/firewire/fwohcivar.h
  user/thompsa/usb/sys/dev/firewire/sbp.c
  user/thompsa/usb/sys/dev/fxp/if_fxp.c
  user/thompsa/usb/sys/dev/hifn/hifn7751.c
  user/thompsa/usb/sys/dev/ichsmb/ichsmb.c
  user/thompsa/usb/sys/dev/ipmi/ipmi_acpi.c
  user/thompsa/usb/sys/dev/ipmi/ipmi_smbios.c
  user/thompsa/usb/sys/dev/kbdmux/kbdmux.c
  user/thompsa/usb/sys/dev/lmc/if_lmc.c
  user/thompsa/usb/sys/dev/lmc/if_lmc.h
  user/thompsa/usb/sys/dev/mmc/mmc.c
  user/thompsa/usb/sys/dev/mmc/mmcreg.h
  user/thompsa/usb/sys/dev/my/if_my.c
  user/thompsa/usb/sys/dev/nve/if_nve.c
  user/thompsa/usb/sys/dev/pccard/card_if.m
  user/thompsa/usb/sys/dev/pccard/pccard.c
  user/thompsa/usb/sys/dev/pccbb/pccbb.c
  user/thompsa/usb/sys/dev/pccbb/pccbb_pci.c
  user/thompsa/usb/sys/dev/pccbb/pccbbvar.h
  user/thompsa/usb/sys/dev/pci/pci_user.c
  user/thompsa/usb/sys/dev/pci/pcireg.h
  user/thompsa/usb/sys/dev/pcn/if_pcn.c
  user/thompsa/usb/sys/dev/ppbus/ppbconf.h
  user/thompsa/usb/sys/dev/ppc/ppc.c
  user/thompsa/usb/sys/dev/ppc/ppcvar.h
  user/thompsa/usb/sys/dev/safe/safe.c
  user/thompsa/usb/sys/dev/scc/scc_if.m
  user/thompsa/usb/sys/dev/smbus/smb.c
  user/thompsa/usb/sys/dev/snp/snp.c
  user/thompsa/usb/sys/dev/usb/ehci_ixp4xx.c   (props changed)
  user/thompsa/usb/sys/dev/usb2/bluetooth/ubtbcmfw2.c
  user/thompsa/usb/sys/dev/usb2/core/usb2_error.c
  user/thompsa/usb/sys/dev/usb2/include/usb2_error.h
  user/thompsa/usb/sys/dev/usb2/include/usb2_hid.h
  user/thompsa/usb/sys/dev/usb2/include/usb2_mfunc.h
  user/thompsa/usb/sys/dev/usb2/include/usb2_revision.h
  user/thompsa/usb/sys/dev/usb2/input/uhid2.c
  user/thompsa/usb/sys/dev/usb2/quirk/usb2_quirk.c
  user/thompsa/usb/sys/dev/usb2/quirk/usb2_quirk.h
  user/thompsa/usb/sys/dev/usb2/serial/uftdi2.c
  user/thompsa/usb/sys/dev/xen/netback/netback.c
  user/thompsa/usb/sys/dev/xen/netfront/netfront.c
  user/thompsa/usb/sys/geom/geom.h
  user/thompsa/usb/sys/geom/geom_subr.c
  user/thompsa/usb/sys/i386/xen/clock.c
  user/thompsa/usb/sys/i386/xen/xen_machdep.c
  user/thompsa/usb/sys/ia64/ia64/mca.c
  user/thompsa/usb/sys/ia64/include/mca.h
  user/thompsa/usb/sys/kern/kern_jail.c
  user/thompsa/usb/sys/kern/subr_autoconf.c
  user/thompsa/usb/sys/kern/subr_bus.c
  user/thompsa/usb/sys/kern/subr_clist.c
  user/thompsa/usb/sys/kern/subr_devstat.c
  user/thompsa/usb/sys/kern/subr_disk.c
  user/thompsa/usb/sys/kern/subr_firmware.c
  user/thompsa/usb/sys/kern/subr_kobj.c
  user/thompsa/usb/sys/kern/subr_prf.c
  user/thompsa/usb/sys/kern/subr_prof.c
  user/thompsa/usb/sys/kern/subr_rman.c
  user/thompsa/usb/sys/kern/subr_rtc.c
  user/thompsa/usb/sys/kern/subr_taskqueue.c
  user/thompsa/usb/sys/kern/subr_witness.c
  user/thompsa/usb/sys/kern/sys_generic.c
  user/thompsa/usb/sys/kern/tty.c
  user/thompsa/usb/sys/kern/tty_inq.c
  user/thompsa/usb/sys/kern/tty_outq.c
  user/thompsa/usb/sys/kern/uipc_socket.c
  user/thompsa/usb/sys/kern/vfs_mount.c
  user/thompsa/usb/sys/kern/vfs_subr.c
  user/thompsa/usb/sys/kern/vfs_syscalls.c
  user/thompsa/usb/sys/mips/mips/elf64_machdep.c   (props changed)
  user/thompsa/usb/sys/modules/usb2/controller_atmegadci/   (props changed)
  user/thompsa/usb/sys/net/if.c
  user/thompsa/usb/sys/net/if_ethersubr.c
  user/thompsa/usb/sys/net/rtsock.c
  user/thompsa/usb/sys/net80211/ieee80211.c
  user/thompsa/usb/sys/net80211/ieee80211_crypto.h
  user/thompsa/usb/sys/net80211/ieee80211_ddb.c
  user/thompsa/usb/sys/net80211/ieee80211_scan_sta.c
  user/thompsa/usb/sys/netatalk/ddp_usrreq.c
  user/thompsa/usb/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c
  user/thompsa/usb/sys/netinet/in.c
  user/thompsa/usb/sys/netinet/in_pcb.c
  user/thompsa/usb/sys/netinet/ip_divert.c
  user/thompsa/usb/sys/netinet/ip_ipsec.c
  user/thompsa/usb/sys/netinet/ip_output.c
  user/thompsa/usb/sys/netinet/raw_ip.c
  user/thompsa/usb/sys/netinet/sctp_auth.c
  user/thompsa/usb/sys/netinet/sctp_constants.h
  user/thompsa/usb/sys/netinet/sctp_crc32.c
  user/thompsa/usb/sys/netinet/sctp_crc32.h
  user/thompsa/usb/sys/netinet/sctp_input.c
  user/thompsa/usb/sys/netinet/sctp_os_bsd.h
  user/thompsa/usb/sys/netinet/sctp_output.c
  user/thompsa/usb/sys/netinet/sctp_pcb.c
  user/thompsa/usb/sys/netinet/sctp_pcb.h
  user/thompsa/usb/sys/netinet/sctp_sysctl.c
  user/thompsa/usb/sys/netinet/sctp_uio.h
  user/thompsa/usb/sys/netinet/sctp_usrreq.c
  user/thompsa/usb/sys/netinet/sctputil.c
  user/thompsa/usb/sys/netinet/sctputil.h
  user/thompsa/usb/sys/netinet/tcp_usrreq.c
  user/thompsa/usb/sys/netinet/udp_usrreq.c
  user/thompsa/usb/sys/netinet6/frag6.c
  user/thompsa/usb/sys/netinet6/in6.c
  user/thompsa/usb/sys/netinet6/in6_pcb.c
  user/thompsa/usb/sys/netinet6/in6_src.c
  user/thompsa/usb/sys/netinet6/ip6_forward.c
  user/thompsa/usb/sys/netinet6/ip6_input.c
  user/thompsa/usb/sys/netinet6/ip6_var.h
  user/thompsa/usb/sys/netinet6/nd6_rtr.c
  user/thompsa/usb/sys/netinet6/raw_ip6.c
  user/thompsa/usb/sys/netinet6/sctp6_usrreq.c
  user/thompsa/usb/sys/netinet6/udp6_usrreq.c
  user/thompsa/usb/sys/netinet6/vinet6.h
  user/thompsa/usb/sys/opencrypto/cryptosoft.c
  user/thompsa/usb/sys/rpc/clnt_rc.c
  user/thompsa/usb/sys/security/audit/audit_pipe.c
  user/thompsa/usb/sys/sys/cfictl.h
  user/thompsa/usb/sys/sys/clist.h
  user/thompsa/usb/sys/sys/conf.h
  user/thompsa/usb/sys/sys/elf_common.h
  user/thompsa/usb/sys/sys/jail.h
  user/thompsa/usb/sys/sys/kobj.h
  user/thompsa/usb/sys/sys/lockmgr.h
  user/thompsa/usb/sys/sys/pciio.h
  user/thompsa/usb/sys/sys/sysctl.h
  user/thompsa/usb/sys/sys/tty.h
  user/thompsa/usb/sys/sys/ttyqueue.h
  user/thompsa/usb/tools/tools/README
  user/thompsa/usb/tools/tools/sysbuild/sysbuild.sh
  user/thompsa/usb/usr.bin/basename/basename.1
  user/thompsa/usb/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
  user/thompsa/usb/usr.bin/dirname/dirname.c
  user/thompsa/usb/usr.bin/make/job.c
  user/thompsa/usb/usr.bin/make/main.c
  user/thompsa/usb/usr.bin/netstat/inet6.c
  user/thompsa/usb/usr.bin/usbhidaction/usbhidaction.c
  user/thompsa/usb/usr.bin/usbhidctl/usbhid.c
  user/thompsa/usb/usr.sbin/bluetooth/Makefile
  user/thompsa/usb/usr.sbin/bluetooth/hcsecd/hcsecd.c
  user/thompsa/usb/usr.sbin/bluetooth/hcseriald/hcseriald.c
  user/thompsa/usb/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c
  user/thompsa/usb/usr.sbin/fifolog/lib/fifolog_reader.c
  user/thompsa/usb/usr.sbin/fifolog/lib/fifolog_write_poll.c
  user/thompsa/usb/usr.sbin/fwcontrol/fwdv.c
  user/thompsa/usb/usr.sbin/fwcontrol/fwmpegts.c
  user/thompsa/usb/usr.sbin/makefs/ffs/ffs_bswap.c   (props changed)
  user/thompsa/usb/usr.sbin/makefs/ffs/ffs_subr.c   (props changed)
  user/thompsa/usb/usr.sbin/makefs/ffs/ufs_bswap.h   (props changed)
  user/thompsa/usb/usr.sbin/makefs/getid.c   (props changed)
  user/thompsa/usb/usr.sbin/pciconf/pciconf.8
  user/thompsa/usb/usr.sbin/pciconf/pciconf.c
  user/thompsa/usb/usr.sbin/pstat/pstat.8
  user/thompsa/usb/usr.sbin/pstat/pstat.c

Modified: user/thompsa/usb/ObsoleteFiles.inc
==============================================================================
--- user/thompsa/usb/ObsoleteFiles.inc	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/ObsoleteFiles.inc	Thu Feb  5 20:13:51 2009	(r188181)
@@ -14,6 +14,8 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20090203: adding_user.8 moved to adding_user.7
+OLD_FILES+=usr/share/man/man8/adding_user.8.gz
 # 20090122: tzdata2009a import
 OLD_FILES+=usr/share/zoneinfo/Asia/Katmandu
 # 20090102: file 4.26 import

Modified: user/thompsa/usb/UPDATING
==============================================================================
--- user/thompsa/usb/UPDATING	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/UPDATING	Thu Feb  5 20:13:51 2009	(r188181)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20090201:
+	INET6 statistics (struct ip6stat) was updated.
+	netstat(1) needs to be recompiled.
+
 20090119:
 	NTFS has been removed from GENERIC kernel on amd64 to match
 	GENERIC on i386. Should not cause any issues since mount_ntfs(8)

Modified: user/thompsa/usb/bin/pax/file_subs.c
==============================================================================
--- user/thompsa/usb/bin/pax/file_subs.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/bin/pax/file_subs.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -425,19 +425,11 @@ node_creat(ARCHD *arcn)
 	 * we were able to create the node. set uid/gid, modes and times
 	 */
 	if (pids)
-		res = ((arcn->type == PAX_SLK) ?
-		    set_lids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid) :
-		    set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid));
+		res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid);
 	else
 		res = 0;
 
 	/*
-	 * symlinks are done now.
-	 */
-	if (arcn->type == PAX_SLK)
-		return(0);
-
-	/*
 	 * IMPORTANT SECURITY NOTE:
 	 * if not preserving mode or we cannot set uid/gid, then PROHIBIT any
 	 * set uid/gid bits
@@ -632,7 +624,7 @@ chk_path( char *name, uid_t st_uid, gid_
  *	used by -t to reset access times).
  *	When ign is zero, only those times the user has asked for are set, the
  *	other ones are left alone. We do not assume the un-documented feature
- *	of many utimes() implementations that consider a 0 time value as a do
+ *	of many lutimes() implementations that consider a 0 time value as a do
  *	not set request.
  */
 
@@ -661,7 +653,7 @@ set_ftime(char *fnm, time_t mtime, time_
 	/*
 	 * set the times
 	 */
-	if (utimes(fnm, tv) < 0)
+	if (lutimes(fnm, tv) < 0)
 		syswarn(1, errno, "Access/modification time set failed on: %s",
 		    fnm);
 	return;
@@ -677,30 +669,6 @@ set_ftime(char *fnm, time_t mtime, time_
 int
 set_ids(char *fnm, uid_t uid, gid_t gid)
 {
-	if (chown(fnm, uid, gid) < 0) {
-		/*
-		 * ignore EPERM unless in verbose mode or being run by root.
-		 * if running as pax, POSIX requires a warning.
-		 */
-		if (strcmp(NM_PAX, argv0) == 0 || errno != EPERM || vflag ||
-		    geteuid() == 0)
-			syswarn(1, errno, "Unable to set file uid/gid of %s",
-			    fnm);
-		return(-1);
-	}
-	return(0);
-}
-
-/*
- * set_lids()
- *	set the uid and gid of a file system node
- * Return:
- *	0 when set, -1 on failure
- */
-
-int
-set_lids(char *fnm, uid_t uid, gid_t gid)
-{
 	if (lchown(fnm, uid, gid) < 0) {
 		/*
 		 * ignore EPERM unless in verbose mode or being run by root.
@@ -724,7 +692,7 @@ void
 set_pmode(char *fnm, mode_t mode)
 {
 	mode &= ABITS;
-	if (chmod(fnm, mode) < 0)
+	if (lchmod(fnm, mode) < 0)
 		syswarn(1, errno, "Could not set permissions on %s", fnm);
 	return;
 }

Modified: user/thompsa/usb/etc/defaults/rc.conf
==============================================================================
--- user/thompsa/usb/etc/defaults/rc.conf	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/etc/defaults/rc.conf	Thu Feb  5 20:13:51 2009	(r188181)
@@ -101,7 +101,7 @@ nisdomainname="NO"		# Set to NIS domain 
 dhclient_program="/sbin/dhclient"	# Path to dhcp client program.
 dhclient_flags=""		# Extra flags to pass to dhcp client.
 #dhclient_flags_fxp0=""		# Extra dhclient flags for fxp0 only
-background_dhclient="NO"	# Start dhcp client in the background.
+background_dhclient="YES"	# Start dhcp client in the background.
 #background_dhclient_fxp0="YES"	# Start dhcp client on fxp0 in the background.
 synchronous_dhclient="NO"	# Start dhclient directly on configured
 				# interfaces during startup.

Modified: user/thompsa/usb/etc/network.subr
==============================================================================
--- user/thompsa/usb/etc/network.subr	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/etc/network.subr	Thu Feb  5 20:13:51 2009	(r188181)
@@ -515,7 +515,9 @@ childif_create()
 			i=`ifconfig wlan create ${create_args}`
 			ifconfig $i name $child && cfg=0
 		fi
-		ifn_start $child
+		if autoif $child; then
+			ifn_start $child
+		fi
 	done
 
 	return ${cfg}

Modified: user/thompsa/usb/etc/rc.d/defaultroute
==============================================================================
--- user/thompsa/usb/etc/rc.d/defaultroute	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/etc/rc.d/defaultroute	Thu Feb  5 20:13:51 2009	(r188181)
@@ -18,10 +18,21 @@ stop_cmd=":"
 
 defaultroute_start()
 {
-	# Return without waiting if we don't have dhcp interfaces.
-	# Once we can test that the link is actually up, we should
-	# remove this test and always wait.
-	[ -z "`list_net_interfaces dhcp`" ] && return
+	local output carrier nocarrier
+
+	# Return without waiting if we don't have dhcp interfaces or
+	# if none of the dhcp interfaces is plugged in.
+	dhcp_interfaces=`list_net_interfaces dhcp`
+	[ -z "${dhcp_interfaces}" ] && return
+	carrier=false
+	for _if in ${dhcp_interfaces}; do
+		output=`/sbin/ifconfig ${_if}` 
+		nocarrier=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'`
+		[ -z "${nocarrier}" ] && carrier=true
+	done
+	if ! ${carrier}; then
+		return
+	fi
 
 	# Wait for a default route
 	delay=${if_up_delay}

Modified: user/thompsa/usb/lib/libarchive/archive_read_support_format_ar.c
==============================================================================
--- user/thompsa/usb/lib/libarchive/archive_read_support_format_ar.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libarchive/archive_read_support_format_ar.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -511,11 +511,10 @@ ar_parse_gnu_filename_table(struct archi
 		}
 	}
 	/*
-	 * Sanity check, last two chars must be `/\n' or '\n\n',
-	 * depending on whether the string table is padded by a '\n'
-	 * (string table produced by GNU ar always has a even size).
+	 * GNU ar always pads the table to an even size.
+	 * The pad character is either '\n' or '`'.
 	 */
-	if (p != ar->strtab + size && *p != '\n')
+	if (p != ar->strtab + size && *p != '\n' && *p != '`')
 		goto bad_string_table;
 
 	/* Enforce zero termination. */

Modified: user/thompsa/usb/lib/libc/sparc64/sys/__sparc_utrap.c
==============================================================================
--- user/thompsa/usb/lib/libc/sparc64/sys/__sparc_utrap.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/sparc64/sys/__sparc_utrap.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -122,7 +122,7 @@ __utrap_write(const char *str)
 }
 
 void
-__utrap_kill_self(sig)
+__utrap_kill_self(int sig)
 {
 	int berrno;
 

Modified: user/thompsa/usb/lib/libc/string/memccpy.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/memccpy.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/memccpy.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -36,11 +36,7 @@ __FBSDID("$FreeBSD$");
 #include <string.h>
 
 void *
-memccpy(t, f, c, n)
-	void *t;
-	const void *f;
-	int c;
-	size_t n;
+memccpy(void *t, const void *f, int c, size_t n)
 {
 
 	if (n) {

Modified: user/thompsa/usb/lib/libc/string/memchr.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/memchr.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/memchr.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -39,10 +39,7 @@ __FBSDID("$FreeBSD$");
 #include <string.h>
 
 void *
-memchr(s, c, n)
-	const void *s;
-	unsigned char c;
-	size_t n;
+memchr(const void *s, int c, size_t n)
 {
 	if (n != 0) {
 		const unsigned char *p = s;

Modified: user/thompsa/usb/lib/libc/string/memcmp.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/memcmp.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/memcmp.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$");
  * Compare memory regions.
  */
 int
-memcmp(s1, s2, n)
-	const void *s1, *s2;
-	size_t n;
+memcmp(const void *s1, const void *s2, size_t n)
 {
 	if (n != 0) {
 		const unsigned char *p1 = s1, *p2 = s2;

Modified: user/thompsa/usb/lib/libc/string/memmem.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/memmem.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/memmem.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$");
  */
 
 void *
-memmem(l, l_len, s, s_len)
-	const void *l; size_t l_len;
-	const void *s; size_t s_len;
+memmem(const void *l, size_t l_len, const void *s, size_t s_len)
 {
 	register char *cur, *last;
 	const char *cl = (const char *)l;

Modified: user/thompsa/usb/lib/libc/string/strcasecmp.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strcasecmp.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strcasecmp.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$");
 typedef unsigned char u_char;
 
 int
-strcasecmp(s1, s2)
-	const char *s1, *s2;
+strcasecmp(const char *s1, const char *s2)
 {
 	const u_char
 			*us1 = (const u_char *)s1,
@@ -53,9 +52,7 @@ strcasecmp(s1, s2)
 }
 
 int
-strncasecmp(s1, s2, n)
-	const char *s1, *s2;
-	size_t n;
+strncasecmp(const char *s1, const char *s2, size_t n)
 {
 	if (n != 0) {
 		const u_char

Modified: user/thompsa/usb/lib/libc/string/strcasestr.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strcasestr.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strcasestr.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$");
  * Find the first occurrence of find in s, ignore case.
  */
 char *
-strcasestr(s, find)
-	const char *s, *find;
+strcasestr(const char *s, const char *find)
 {
 	char c, sc;
 	size_t len;

Modified: user/thompsa/usb/lib/libc/string/strcmp.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strcmp.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strcmp.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -42,11 +42,10 @@ __FBSDID("$FreeBSD$");
  * Compare strings.
  */
 int
-strcmp(s1, s2)
-	const char *s1, *s2;
+strcmp(const char *s1, const char *s2)
 {
 	while (*s1 == *s2++)
-		if (*s1++ == 0)
+		if (*s1++ == '\0')
 			return (0);
 	return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
 }

Modified: user/thompsa/usb/lib/libc/string/strcoll.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strcoll.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strcoll.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -33,8 +33,7 @@ __FBSDID("$FreeBSD$");
 #include "collate.h"
 
 int
-strcoll(s, s2)
-	const char *s, *s2;
+strcoll(const char *s, const char *s2)
 {
 	int len, len2, prim, prim2, sec, sec2, ret, ret2;
 	const char *t, *t2;

Modified: user/thompsa/usb/lib/libc/string/strdup.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strdup.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strdup.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -38,8 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <string.h>
 
 char *
-strdup(str)
-	const char *str;
+strdup(const char *str)
 {
 	size_t len;
 	char *copy;

Modified: user/thompsa/usb/lib/libc/string/strmode.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strmode.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strmode.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -38,9 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <string.h>
 
 void
-strmode(mode, p)
-	mode_t mode;
-	char *p;
+strmode(/* mode_t */ int mode, char *p)
 {
 	 /* print type */
 	switch (mode & S_IFMT) {

Modified: user/thompsa/usb/lib/libc/string/strncmp.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strncmp.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strncmp.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$");
 #include <string.h>
 
 int
-strncmp(s1, s2, n)
-	const char *s1, *s2;
-	size_t n;
+strncmp(const char *s1, const char *s2, size_t n)
 {
 
 	if (n == 0)
@@ -47,7 +45,7 @@ strncmp(s1, s2, n)
 		if (*s1 != *s2++)
 			return (*(const unsigned char *)s1 -
 				*(const unsigned char *)(s2 - 1));
-		if (*s1++ == 0)
+		if (*s1++ == '\0')
 			break;
 	} while (--n != 0);
 	return (0);

Modified: user/thompsa/usb/lib/libc/string/strncpy.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strncpy.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strncpy.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -50,10 +50,10 @@ strncpy(char * __restrict dst, const cha
 		const char *s = src;
 
 		do {
-			if ((*d++ = *s++) == 0) {
+			if ((*d++ = *s++) == '\0') {
 				/* NUL pad the remaining n-1 bytes */
 				while (--n != 0)
-					*d++ = 0;
+					*d++ = '\0';
 				break;
 			}
 		} while (--n != 0);

Modified: user/thompsa/usb/lib/libc/string/strnstr.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strnstr.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strnstr.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -44,10 +44,7 @@ __FBSDID("$FreeBSD$");
  * first slen characters of s.
  */
 char *
-strnstr(s, find, slen)
-	const char *s;
-	const char *find;
-	size_t slen;
+strnstr(const char *s, const char *find, size_t slen)
 {
 	char c, sc;
 	size_t len;

Modified: user/thompsa/usb/lib/libc/string/strpbrk.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strpbrk.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strpbrk.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -39,14 +39,13 @@ __FBSDID("$FreeBSD$");
  * Find the first occurrence in s1 of a character in s2 (excluding NUL).
  */
 char *
-strpbrk(s1, s2)
-	const char *s1, *s2;
+strpbrk(const char *s1, const char *s2)
 {
 	const char *scanp;
 	int c, sc;
 
 	while ((c = *s1++) != 0) {
-		for (scanp = s2; (sc = *scanp++) != 0;)
+		for (scanp = s2; (sc = *scanp++) != '\0';)
 			if (sc == c)
 				return ((char *)(s1 - 1));
 	}

Modified: user/thompsa/usb/lib/libc/string/strsep.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strsep.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strsep.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$");
  * If *stringp is NULL, strsep returns NULL.
  */
 char *
-strsep(stringp, delim)
-	char **stringp;
-	const char *delim;
+strsep(char **stringp, const char *delim)
 {
 	char *s;
 	const char *spanp;

Modified: user/thompsa/usb/lib/libc/string/strstr.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/strstr.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/strstr.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -42,17 +42,16 @@ __FBSDID("$FreeBSD$");
  * Find the first occurrence of find in s.
  */
 char *
-strstr(s, find)
-	const char *s, *find;
+strstr(const char *s, const char *find)
 {
 	char c, sc;
 	size_t len;
 
-	if ((c = *find++) != 0) {
+	if ((c = *find++) != '\0') {
 		len = strlen(find);
 		do {
 			do {
-				if ((sc = *s++) == 0)
+				if ((sc = *s++) == '\0')
 					return (NULL);
 			} while (sc != c);
 		} while (strncmp(s, find, len) != 0);

Modified: user/thompsa/usb/lib/libc/string/wcscat.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcscat.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcscat.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 wchar_t *
-wcscat(s1, s2)
-	wchar_t * __restrict s1;
-	const wchar_t * __restrict s2;
+wcscat(wchar_t * __restrict s1, const wchar_t * __restrict s2)
 {
 	wchar_t *cp;
 

Modified: user/thompsa/usb/lib/libc/string/wcscmp.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcscmp.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcscmp.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -45,12 +45,11 @@ __FBSDID("$FreeBSD$");
  * Compare strings.
  */
 int
-wcscmp(s1, s2)
-	const wchar_t *s1, *s2;
+wcscmp(const wchar_t *s1, const wchar_t *s2)
 {
 
 	while (*s1 == *s2++)
-		if (*s1++ == 0)
+		if (*s1++ == '\0')
 			return (0);
 	/* XXX assumes wchar_t = int */
 	return (*(const unsigned int *)s1 - *(const unsigned int *)--s2);

Modified: user/thompsa/usb/lib/libc/string/wcscpy.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcscpy.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcscpy.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 wchar_t *
-wcscpy(s1, s2)
-	wchar_t * __restrict s1;
-	const wchar_t * __restrict s2;
+wcscpy(wchar_t * __restrict s1, const wchar_t * __restrict s2)
 {
 	wchar_t *cp;
 

Modified: user/thompsa/usb/lib/libc/string/wcscspn.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcscspn.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcscspn.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 size_t
-wcscspn(s, set)
-	const wchar_t *s;
-	const wchar_t *set;
+wcscspn(const wchar_t *s, const wchar_t *set)
 {
 	const wchar_t *p;
 	const wchar_t *q;

Modified: user/thompsa/usb/lib/libc/string/wcslcat.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcslcat.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcslcat.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -46,10 +46,7 @@ __FBSDID("$FreeBSD$");
  * truncation occurred.
  */
 size_t
-wcslcat(dst, src, siz)
-	wchar_t *dst;
-	const wchar_t *src;
-	size_t siz;
+wcslcat(wchar_t *dst, const wchar_t *src, size_t siz)
 {
 	wchar_t *d = dst;
 	const wchar_t *s = src;

Modified: user/thompsa/usb/lib/libc/string/wcslcpy.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcslcpy.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcslcpy.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -44,10 +44,7 @@ __FBSDID("$FreeBSD$");
  * Returns wcslen(src); if retval >= siz, truncation occurred.
  */
 size_t
-wcslcpy(dst, src, siz)
-	wchar_t *dst;
-	const wchar_t *src;
-	size_t siz;
+wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz)
 {
 	wchar_t *d = dst;
 	const wchar_t *s = src;

Modified: user/thompsa/usb/lib/libc/string/wcslen.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcslen.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcslen.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,8 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 size_t
-wcslen(s)
-	const wchar_t *s;
+wcslen(const wchar_t *s)
 {
 	const wchar_t *p;
 

Modified: user/thompsa/usb/lib/libc/string/wcsncat.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcsncat.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcsncat.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 wchar_t *
-wcsncat(s1, s2, n)
-	wchar_t * __restrict s1;
-	const wchar_t * __restrict s2;
-	size_t n;
+wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n)
 {
 	wchar_t *p;
 	wchar_t *q;

Modified: user/thompsa/usb/lib/libc/string/wcsncmp.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcsncmp.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcsncmp.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 int
-wcsncmp(s1, s2, n)
-	const wchar_t *s1, *s2;
-	size_t n;
+wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n)
 {
 
 	if (n == 0)

Modified: user/thompsa/usb/lib/libc/string/wcspbrk.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcspbrk.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcspbrk.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 wchar_t *
-wcspbrk(s, set)
-	const wchar_t *s;
-	const wchar_t *set;
+wcspbrk(const wchar_t *s, const wchar_t *set)
 {
 	const wchar_t *p;
 	const wchar_t *q;

Modified: user/thompsa/usb/lib/libc/string/wcsspn.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcsspn.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcsspn.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 size_t
-wcsspn(s, set)
-	const wchar_t *s;
-	const wchar_t *set;
+wcsspn(const wchar_t *s, const wchar_t *set)
 {
 	const wchar_t *p;
 	const wchar_t *q;

Modified: user/thompsa/usb/lib/libc/string/wcsstr.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wcsstr.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wcsstr.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -49,7 +49,7 @@ wcsstr(const wchar_t * __restrict s, con
 	wchar_t c, sc;
 	size_t len;
 
-	if ((c = *find++) != 0) {
+	if ((c = *find++) != L'\0') {
 		len = wcslen(find);
 		do {
 			do {

Modified: user/thompsa/usb/lib/libc/string/wmemchr.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wmemchr.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wmemchr.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 wchar_t	*
-wmemchr(s, c, n)
-	const wchar_t *s;
-	wchar_t c;
-	size_t n;
+wmemchr(const wchar_t *s, wchar_t c, size_t n)
 {
 	size_t i;
 

Modified: user/thompsa/usb/lib/libc/string/wmemcmp.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wmemcmp.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wmemcmp.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 int
-wmemcmp(s1, s2, n)
-	const wchar_t *s1;
-	const wchar_t *s2;
-	size_t n;
+wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n)
 {
 	size_t i;
 

Modified: user/thompsa/usb/lib/libc/string/wmemcpy.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wmemcpy.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wmemcpy.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -38,11 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 wchar_t *
-wmemcpy(d, s, n)
-	wchar_t * __restrict d;
-	const wchar_t * __restrict s;
-	size_t n;
+wmemcpy(wchar_t * __restrict d, const wchar_t * __restrict s, size_t n)
 {
-
 	return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t));
 }

Modified: user/thompsa/usb/lib/libc/string/wmemmove.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wmemmove.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wmemmove.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -38,11 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 wchar_t *
-wmemmove(d, s, n)
-	wchar_t *d;
-	const wchar_t *s;
-	size_t n;
+wmemmove(wchar_t *d, const wchar_t *s, size_t n)
 {
-
 	return (wchar_t *)memmove(d, s, n * sizeof(wchar_t));
 }

Modified: user/thompsa/usb/lib/libc/string/wmemset.c
==============================================================================
--- user/thompsa/usb/lib/libc/string/wmemset.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/string/wmemset.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 
 wchar_t	*
-wmemset(s, c, n)
-	wchar_t *s;
-	wchar_t c;
-	size_t n;
+wmemset(wchar_t *s, wchar_t c, size_t n)
 {
 	size_t i;
 	wchar_t *p;

Modified: user/thompsa/usb/lib/libc/sys/send.2
==============================================================================
--- user/thompsa/usb/lib/libc/sys/send.2	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libc/sys/send.2	Thu Feb  5 20:13:51 2009	(r188181)
@@ -28,7 +28,7 @@
 .\"     From: @(#)send.2	8.2 (Berkeley) 2/21/94
 .\" $FreeBSD$
 .\"
-.Dd September 13, 2006
+.Dd February 5, 2009
 .Dt SEND 2
 .Os
 .Sh NAME
@@ -190,7 +190,7 @@ receiver is not listening on the remote 
 The remote host was down.
 .It Bq Er ENETDOWN
 The remote network was down.
-.It Bq Er EPERM
+.It Bq Er EADDRNOTAVAIL
 The process using a
 .Dv SOCK_RAW
 socket was jailed and the source

Modified: user/thompsa/usb/lib/libusbhid/Makefile
==============================================================================
--- user/thompsa/usb/lib/libusbhid/Makefile	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libusbhid/Makefile	Thu Feb  5 20:13:51 2009	(r188181)
@@ -15,7 +15,7 @@ MLINKS=	usbhid.3 libusbhid.3 usbhid.3 hi
 	usbhid.3 hid_init.3 \
 	usbhid.3 hid_get_data.3 usbhid.3 hid_set_data.3
 
-SRCS=	descr.c parse.c usage.c data.c
+SRCS=	descr.c descr_compat.c parse.c usage.c data.c
 
 INCS=	usbhid.h
 

Modified: user/thompsa/usb/lib/libusbhid/descr.c
==============================================================================
--- user/thompsa/usb/lib/libusbhid/descr.c	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libusbhid/descr.c	Thu Feb  5 20:13:51 2009	(r188181)
@@ -39,21 +39,83 @@ __FBSDID("$FreeBSD$");
 #include <sys/time.h>
 #include <sys/ioctl.h>
 
-#include <dev/usb/usb.h>
+#include <dev/usb2/include/usb2_ioctl.h>
 
 #include "usbhid.h"
 #include "usbvar.h"
 
+int
+hid_set_immed(int fd, int enable)
+{
+	int ret;
+	ret = ioctl(fd, USB_SET_IMMED, &enable);
+	if (ret < 0)
+		ret = hid_set_immed_compat7(fd, enable);
+	return (ret);
+}
+
+int
+hid_get_report_id(int fd)
+{
+	int temp = -1;
+	int ret;
+
+	ret = ioctl(fd, USB_GET_REPORT_ID, &temp);
+	if (ret < 0)
+		ret = hid_get_report_id_compat7(fd);
+	else
+		ret = temp;
+
+	return (ret);
+}
+
 report_desc_t
 hid_get_report_desc(int fd)
 {
-	struct usb_ctl_report_desc rep;
+	struct usb2_gen_descriptor ugd;
+	report_desc_t rep;
+	void *data;
+
+	memset(&ugd, 0, sizeof(ugd));
+
+	/* get actual length first */
+	ugd.ugd_data = NULL;
+	ugd.ugd_maxlen = 65535;
+	if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) {
+		/* could not read descriptor */
+		/* try FreeBSD 7 compat code */
+		return (hid_get_report_desc_compat7(fd));
+	}
 
-	rep.ucrd_size = 0;
-	if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
+	/*
+	 * NOTE: The kernel will return a failure if 
+	 * "ugd_actlen" is zero.
+	 */
+	data = malloc(ugd.ugd_actlen);
+	if (data == NULL)
 		return (NULL);
 
-	return hid_use_report_desc(rep.ucrd_data, (unsigned int)rep.ucrd_size);
+	/* fetch actual descriptor */
+	ugd.ugd_data = data;
+	ugd.ugd_maxlen = ugd.ugd_actlen;
+	if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) {
+		/* could not read descriptor */
+		free(data);
+		return (NULL);
+	}
+
+	/* check END_COLLECTION */
+	if (((unsigned char *)ugd.ugd_data)[ugd.ugd_actlen -1] != 0xC0) {
+		/* invalid end byte */
+		free(data);
+		return (NULL);
+	}
+
+	rep = hid_use_report_desc(data, ugd.ugd_actlen);
+
+	free(data);
+
+	return (rep);
 }
 
 report_desc_t

Copied: user/thompsa/usb/lib/libusbhid/descr_compat.c (from r188180, head/lib/libusbhid/descr_compat.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/thompsa/usb/lib/libusbhid/descr_compat.c	Thu Feb  5 20:13:51 2009	(r188181, copy of r188180, head/lib/libusbhid/descr_compat.c)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 1999 Lennart Augustsson <augustss at netbsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+ */
+
+/*
+ * This file contains fallback-compatibility code for the old FreeBSD
+ * USB stack.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+
+#include <dev/usb/usb.h>
+
+#include "usbhid.h"
+#include "usbvar.h"
+
+int
+hid_set_immed_compat7(int fd, int enable)
+{
+	return (ioctl(fd, USB_SET_IMMED, &enable));
+}
+
+int
+hid_get_report_id_compat7(int fd)
+{
+	int temp = -1;
+
+	if (ioctl(fd, USB_GET_REPORT_ID, &temp) < 0)
+		return (-1);
+
+	return (temp);
+}
+
+report_desc_t
+hid_get_report_desc_compat7(int fd)
+{
+	struct usb_ctl_report_desc rep;
+
+	rep.ucrd_size = 0;
+	if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
+		return (NULL);
+
+	return (hid_use_report_desc(rep.ucrd_data, (unsigned int)rep.ucrd_size));
+}

Modified: user/thompsa/usb/lib/libusbhid/usbhid.3
==============================================================================
--- user/thompsa/usb/lib/libusbhid/usbhid.3	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libusbhid/usbhid.3	Thu Feb  5 20:13:51 2009	(r188181)
@@ -26,12 +26,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 29, 2001
+.Dd January 27, 2009
 .Dt USBHID 3
 .Os
 .Sh NAME
 .Nm usbhid ,
 .Nm hid_get_report_desc ,
+.Nm hid_get_report_id ,
 .Nm hid_use_report_desc ,
 .Nm hid_dispose_report_desc ,
 .Nm hid_start_parse ,
@@ -51,6 +52,10 @@
 .In usbhid.h
 .Ft report_desc_t
 .Fn hid_get_report_desc "int file"
+.Ft int
+.Fn hid_get_report_id "int file"
+.Ft int
+.Fn hid_set_immed "int fd" "int enable"
 .Ft report_desc_t
 .Fn hid_use_report_desc "unsigned char *data" "unsigned int size"
 .Ft void
@@ -94,7 +99,15 @@ which contains the data layout informati
 The routines can be divided into four parts: extraction of the descriptor,
 parsing of the descriptor, translating to/from symbolic names, and
 data manipulation.
+.Ss Synchronous HID operation
+Synchronous HID operation can be enabled or disabled by a call to
+.Fn hid_set_immed .
+If the second argument is zero synchronous HID operation is disabled.
+Else synchronous HID operation is enabled.
+The function returns a negative value on failure.
 .Ss Descriptor Functions
+The report descriptor ID can be obtained by calling
+.Fn hid_get_report_id .
 A report descriptor can be obtained by calling
 .Fn hid_get_report_desc
 with a file descriptor obtained by opening a

Modified: user/thompsa/usb/lib/libusbhid/usbhid.h
==============================================================================
--- user/thompsa/usb/lib/libusbhid/usbhid.h	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libusbhid/usbhid.h	Thu Feb  5 20:13:51 2009	(r188181)
@@ -87,6 +87,8 @@ __BEGIN_DECLS
 report_desc_t hid_get_report_desc(int file);
 report_desc_t hid_use_report_desc(unsigned char *data, unsigned int size);
 void hid_dispose_report_desc(report_desc_t);
+int hid_get_report_id(int file);
+int hid_set_immed(int fd, int enable);
 
 /* Parsing of a HID report descriptor, parse.c: */
 hid_data_t hid_start_parse(report_desc_t d, int kindset, int id);

Modified: user/thompsa/usb/lib/libusbhid/usbvar.h
==============================================================================
--- user/thompsa/usb/lib/libusbhid/usbvar.h	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/lib/libusbhid/usbvar.h	Thu Feb  5 20:13:51 2009	(r188181)
@@ -34,3 +34,8 @@ struct report_desc {
 	unsigned char data[1];
 };
 
+/* internal backwards compatibility functions */
+
+int	hid_set_immed_compat7(int fd, int enable);
+int	hid_get_report_id_compat7(int fd);
+report_desc_t	hid_get_report_desc_compat7(int fd);

Modified: user/thompsa/usb/sbin/fsck_ffs/fsck.h
==============================================================================
--- user/thompsa/usb/sbin/fsck_ffs/fsck.h	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/sbin/fsck_ffs/fsck.h	Thu Feb  5 20:13:51 2009	(r188181)
@@ -270,7 +270,7 @@ char	yflag;			/* assume a yes response *
 int	bkgrdflag;		/* use a snapshot to run on an active system */
 int	bflag;			/* location of alternate super block */
 int	debug;			/* output debugging info */
-char	damagedflag;		/* run in damaged mode */
+int	inoopt;			/* trim out unused inodes */
 char	ckclean;		/* only do work if not cleanly unmounted */
 int	cvtlevel;		/* convert to newer file system format */
 int	bkgrdcheck;		/* determine if background check is possible */
@@ -337,7 +337,7 @@ void		cacheino(union dinode *dp, ino_t i
 void		catch(int);
 void		catchquit(int);
 int		changeino(ino_t dir, const char *name, ino_t newnum);
-void		check_cgmagic(int cg, struct cg *cgp);
+int		check_cgmagic(int cg, struct cg *cgp);
 int		chkrange(ufs2_daddr_t blk, int cnt);
 void		ckfini(int markclean);
 int		ckinode(union dinode *dp, struct inodesc *);
@@ -362,7 +362,7 @@ int		ftypeok(union dinode *dp);
 void		getblk(struct bufarea *bp, ufs2_daddr_t blk, long size);
 struct bufarea *getdatablk(ufs2_daddr_t blkno, long size);
 struct inoinfo *getinoinfo(ino_t inumber);
-union dinode   *getnextinode(ino_t inumber);
+union dinode   *getnextinode(ino_t inumber, int rebuildcg);
 void		getpathname(char *namebuf, ino_t curdir, ino_t ino);
 union dinode   *ginode(ino_t inumber);
 void		infohandler(int sig);

Modified: user/thompsa/usb/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- user/thompsa/usb/sbin/fsck_ffs/fsck_ffs.8	Thu Feb  5 19:39:07 2009	(r188180)
+++ user/thompsa/usb/sbin/fsck_ffs/fsck_ffs.8	Thu Feb  5 20:13:51 2009	(r188181)
@@ -38,7 +38,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl BDFpfny
+.Op Fl BFprfny
 .Op Fl b Ar block
 .Op Fl c Ar level
 .Op Fl m Ar mode
@@ -216,22 +216,6 @@ are being converted at once.
 The format of a file system can be determined from the
 first line of output from
 .Xr dumpfs 8 .
-.It Fl D
-Run
-.Nm
-in 'damaged recovery' mode, which will enable certain aggressive
-operations that can make
-.Nm
-to survive with file systems that has very serious data damage, which
-is an useful last resort when on disk data damage is very serious
-and causes
-.Nm
-to crash otherwise.  Be
-.Em very careful
-using this flag, it is dangerous if there are data transmission hazards
-because a false positive cylinder group magic number mismatch could
-cause
-.Em irrevertible data loss!
 .Pp
 This option implies the
 .Fl f
@@ -259,6 +243,15 @@ which is assumed to be affirmative;
 do not open the file system for writing.
 .It Fl p

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-user mailing list