Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Feb 2011 19:20:21 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r218200 - in projects/binutils-2.17: . bin/sh contrib/top contrib/tzdata etc etc/mail etc/rc.d gnu/lib/libgomp lib/csu/mips lib/libkvm lib/liblzma libexec/rtld-elf sbin/hastd sbin/ifcon...
Message-ID:  <201102021920.p12JKL0x019166@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Wed Feb  2 19:20:20 2011
New Revision: 218200
URL: http://svn.freebsd.org/changeset/base/218200

Log:
  Sync: merge r218029 through r218199 from ^/head.

Added:
  projects/binutils-2.17/sys/dev/ath/if_ath_debug.c
     - copied unchanged from r218199, head/sys/dev/ath/if_ath_debug.c
  projects/binutils-2.17/sys/dev/ath/if_ath_debug.h
     - copied unchanged from r218199, head/sys/dev/ath/if_ath_debug.h
  projects/binutils-2.17/sys/dev/ath/if_ath_misc.h
     - copied unchanged from r218199, head/sys/dev/ath/if_ath_misc.h
  projects/binutils-2.17/sys/dev/ath/if_ath_tx.c
     - copied unchanged from r218199, head/sys/dev/ath/if_ath_tx.c
  projects/binutils-2.17/sys/dev/ath/if_ath_tx.h
     - copied unchanged from r218199, head/sys/dev/ath/if_ath_tx.h
  projects/binutils-2.17/sys/dev/ath/if_ath_tx_ht.c
     - copied unchanged from r218199, head/sys/dev/ath/if_ath_tx_ht.c
  projects/binutils-2.17/sys/dev/ath/if_ath_tx_ht.h
     - copied unchanged from r218199, head/sys/dev/ath/if_ath_tx_ht.h
  projects/binutils-2.17/sys/modules/cc/cc_chd/
     - copied from r218199, head/sys/modules/cc/cc_chd/
  projects/binutils-2.17/sys/modules/cc/cc_hd/
     - copied from r218199, head/sys/modules/cc/cc_hd/
  projects/binutils-2.17/sys/modules/cc/cc_vegas/
     - copied from r218199, head/sys/modules/cc/cc_vegas/
  projects/binutils-2.17/sys/netinet/cc/cc_chd.c
     - copied unchanged from r218199, head/sys/netinet/cc/cc_chd.c
  projects/binutils-2.17/sys/netinet/cc/cc_hd.c
     - copied unchanged from r218199, head/sys/netinet/cc/cc_hd.c
  projects/binutils-2.17/sys/netinet/cc/cc_vegas.c
     - copied unchanged from r218199, head/sys/netinet/cc/cc_vegas.c
  projects/binutils-2.17/tools/regression/bin/sh/execution/killed2.0
     - copied unchanged from r218199, head/tools/regression/bin/sh/execution/killed2.0
Modified:
  projects/binutils-2.17/Makefile
  projects/binutils-2.17/Makefile.inc1
  projects/binutils-2.17/bin/sh/jobs.c
  projects/binutils-2.17/contrib/top/display.c
  projects/binutils-2.17/contrib/tzdata/australasia
  projects/binutils-2.17/contrib/tzdata/northamerica
  projects/binutils-2.17/etc/ftpusers
  projects/binutils-2.17/etc/group
  projects/binutils-2.17/etc/mail/aliases
  projects/binutils-2.17/etc/master.passwd
  projects/binutils-2.17/etc/rc.d/rpcbind
  projects/binutils-2.17/gnu/lib/libgomp/Makefile
  projects/binutils-2.17/lib/csu/mips/crt1.c
  projects/binutils-2.17/lib/libkvm/kvm.c
  projects/binutils-2.17/lib/liblzma/config.h
  projects/binutils-2.17/libexec/rtld-elf/rtld.c
  projects/binutils-2.17/sbin/hastd/hast.h
  projects/binutils-2.17/sbin/hastd/hastd.c
  projects/binutils-2.17/sbin/hastd/hastd.h
  projects/binutils-2.17/sbin/hastd/pjdlog.c
  projects/binutils-2.17/sbin/hastd/pjdlog.h
  projects/binutils-2.17/sbin/hastd/primary.c
  projects/binutils-2.17/sbin/hastd/proto.c
  projects/binutils-2.17/sbin/hastd/proto.h
  projects/binutils-2.17/sbin/hastd/proto_common.c
  projects/binutils-2.17/sbin/hastd/proto_impl.h
  projects/binutils-2.17/sbin/hastd/proto_socketpair.c
  projects/binutils-2.17/sbin/hastd/proto_tcp4.c
  projects/binutils-2.17/sbin/hastd/proto_uds.c
  projects/binutils-2.17/sbin/hastd/secondary.c
  projects/binutils-2.17/sbin/hastd/subr.c
  projects/binutils-2.17/sbin/hastd/subr.h
  projects/binutils-2.17/sbin/ifconfig/ifieee80211.c
  projects/binutils-2.17/share/syscons/keymaps/Makefile
  projects/binutils-2.17/sys/amd64/amd64/uio_machdep.c
  projects/binutils-2.17/sys/amd64/linux32/linux32_machdep.c
  projects/binutils-2.17/sys/amd64/linux32/linux32_proto.h
  projects/binutils-2.17/sys/amd64/linux32/syscalls.master
  projects/binutils-2.17/sys/arm/arm/uio_machdep.c
  projects/binutils-2.17/sys/arm/include/fdt.h
  projects/binutils-2.17/sys/arm/s3c2xx0/std.ln2410sbc
  projects/binutils-2.17/sys/cddl/compat/opensolaris/sys/types.h
  projects/binutils-2.17/sys/compat/linprocfs/linprocfs.c
  projects/binutils-2.17/sys/compat/linux/linux_futex.c
  projects/binutils-2.17/sys/compat/linux/linux_futex.h
  projects/binutils-2.17/sys/compat/linux/linux_misc.c
  projects/binutils-2.17/sys/compat/linux/linux_misc.h
  projects/binutils-2.17/sys/conf/files
  projects/binutils-2.17/sys/conf/kern.pre.mk
  projects/binutils-2.17/sys/dev/ahci/ahci.c
  projects/binutils-2.17/sys/dev/alc/if_alc.c
  projects/binutils-2.17/sys/dev/ata/ata-pci.h
  projects/binutils-2.17/sys/dev/ata/chipsets/ata-intel.c
  projects/binutils-2.17/sys/dev/ath/ath_hal/ah.c
  projects/binutils-2.17/sys/dev/ath/ath_hal/ah.h
  projects/binutils-2.17/sys/dev/ath/ath_hal/ah_internal.h
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416.h
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416phy.h
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar9002/ar9280.h
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar9002/ar9285.h
  projects/binutils-2.17/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  projects/binutils-2.17/sys/dev/ath/ath_rate/amrr/amrr.c
  projects/binutils-2.17/sys/dev/ath/ath_rate/onoe/onoe.c
  projects/binutils-2.17/sys/dev/ath/ath_rate/sample/sample.c
  projects/binutils-2.17/sys/dev/ath/if_ath.c
  projects/binutils-2.17/sys/dev/ath/if_athrate.h
  projects/binutils-2.17/sys/dev/ath/if_athvar.h
  projects/binutils-2.17/sys/dev/cs/if_cs.c
  projects/binutils-2.17/sys/dev/cs/if_csreg.h
  projects/binutils-2.17/sys/dev/cs/if_csvar.h
  projects/binutils-2.17/sys/dev/fdt/fdt_common.c
  projects/binutils-2.17/sys/dev/fdt/fdt_pci.c
  projects/binutils-2.17/sys/dev/fdt/fdtbus.c
  projects/binutils-2.17/sys/dev/flash/mx25l.c
  projects/binutils-2.17/sys/dev/ichsmb/ichsmb_pci.c
  projects/binutils-2.17/sys/dev/ichwd/ichwd.c
  projects/binutils-2.17/sys/dev/ichwd/ichwd.h
  projects/binutils-2.17/sys/dev/sound/pci/hda/hdac.c
  projects/binutils-2.17/sys/dev/tsec/if_tsec_fdt.c
  projects/binutils-2.17/sys/dev/usb/serial/u3g.c
  projects/binutils-2.17/sys/dev/usb/usb_pf.c
  projects/binutils-2.17/sys/dev/usb/usb_pf.h
  projects/binutils-2.17/sys/dev/usb/usbdevs
  projects/binutils-2.17/sys/dev/xen/netfront/netfront.c
  projects/binutils-2.17/sys/fs/ext2fs/ext2_alloc.c
  projects/binutils-2.17/sys/fs/ext2fs/ext2_mount.h
  projects/binutils-2.17/sys/fs/ext2fs/ext2_vfsops.c
  projects/binutils-2.17/sys/fs/ext2fs/ext2fs.h
  projects/binutils-2.17/sys/i386/i386/uio_machdep.c
  projects/binutils-2.17/sys/i386/linux/linux_machdep.c
  projects/binutils-2.17/sys/i386/linux/linux_proto.h
  projects/binutils-2.17/sys/i386/linux/syscalls.master
  projects/binutils-2.17/sys/ia64/ia64/uio_machdep.c
  projects/binutils-2.17/sys/kern/imgact_elf.c
  projects/binutils-2.17/sys/kern/subr_uio.c
  projects/binutils-2.17/sys/kern/uipc_usrreq.c
  projects/binutils-2.17/sys/kern/vfs_mount.c
  projects/binutils-2.17/sys/kern/vfs_subr.c
  projects/binutils-2.17/sys/mips/mips/uio_machdep.c
  projects/binutils-2.17/sys/modules/ath/Makefile
  projects/binutils-2.17/sys/modules/cc/Makefile
  projects/binutils-2.17/sys/net80211/ieee80211_ioctl.c
  projects/binutils-2.17/sys/net80211/ieee80211_scan.c
  projects/binutils-2.17/sys/netinet/cc.h
  projects/binutils-2.17/sys/netinet/cc/cc_newreno.c
  projects/binutils-2.17/sys/netinet/sctp.h
  projects/binutils-2.17/sys/netinet/sctp_cc_functions.c
  projects/binutils-2.17/sys/netinet/sctp_constants.h
  projects/binutils-2.17/sys/netinet/sctp_header.h
  projects/binutils-2.17/sys/netinet/sctp_indata.c
  projects/binutils-2.17/sys/netinet/sctp_indata.h
  projects/binutils-2.17/sys/netinet/sctp_input.c
  projects/binutils-2.17/sys/netinet/sctp_output.c
  projects/binutils-2.17/sys/netinet/sctp_output.h
  projects/binutils-2.17/sys/netinet/sctp_pcb.c
  projects/binutils-2.17/sys/netinet/sctp_pcb.h
  projects/binutils-2.17/sys/netinet/sctp_structs.h
  projects/binutils-2.17/sys/netinet/sctp_sysctl.c
  projects/binutils-2.17/sys/netinet/sctp_sysctl.h
  projects/binutils-2.17/sys/netinet/sctp_timer.c
  projects/binutils-2.17/sys/netinet/sctp_uio.h
  projects/binutils-2.17/sys/netinet/sctputil.c
  projects/binutils-2.17/sys/netinet/sctputil.h
  projects/binutils-2.17/sys/netinet/tcp_usrreq.c
  projects/binutils-2.17/sys/powerpc/include/fdt.h
  projects/binutils-2.17/sys/powerpc/include/intr_machdep.h
  projects/binutils-2.17/sys/powerpc/include/openpicvar.h
  projects/binutils-2.17/sys/powerpc/mambo/mambo_openpic.c
  projects/binutils-2.17/sys/powerpc/mpc85xx/atpic.c
  projects/binutils-2.17/sys/powerpc/mpc85xx/isa.c
  projects/binutils-2.17/sys/powerpc/mpc85xx/nexus.c
  projects/binutils-2.17/sys/powerpc/mpc85xx/openpic_fdt.c
  projects/binutils-2.17/sys/powerpc/mpc85xx/pci_fdt.c
  projects/binutils-2.17/sys/powerpc/ofw/ofw_pcib_pci.c
  projects/binutils-2.17/sys/powerpc/ofw/ofw_pcibus.c
  projects/binutils-2.17/sys/powerpc/powermac/cpcht.c
  projects/binutils-2.17/sys/powerpc/powermac/grackle.c
  projects/binutils-2.17/sys/powerpc/powermac/hrowpic.c
  projects/binutils-2.17/sys/powerpc/powermac/macgpio.c
  projects/binutils-2.17/sys/powerpc/powermac/macio.c
  projects/binutils-2.17/sys/powerpc/powermac/openpic_macio.c
  projects/binutils-2.17/sys/powerpc/powermac/uninorth.c
  projects/binutils-2.17/sys/powerpc/powermac/uninorthpci.c
  projects/binutils-2.17/sys/powerpc/powerpc/intr_machdep.c
  projects/binutils-2.17/sys/powerpc/powerpc/openpic.c
  projects/binutils-2.17/sys/powerpc/powerpc/pic_if.m
  projects/binutils-2.17/sys/powerpc/powerpc/uio_machdep.c
  projects/binutils-2.17/sys/powerpc/ps3/ps3pic.c
  projects/binutils-2.17/sys/powerpc/psim/openpic_iobus.c
  projects/binutils-2.17/sys/sparc64/sparc64/uio_machdep.c
  projects/binutils-2.17/sys/sun4v/sun4v/uio_machdep.c
  projects/binutils-2.17/sys/sys/uio.h
  projects/binutils-2.17/sys/sys/vnode.h
  projects/binutils-2.17/sys/ufs/ffs/ffs_rawread.c
  projects/binutils-2.17/sys/ufs/ffs/ffs_softdep.c
  projects/binutils-2.17/sys/vm/vm_map.c
  projects/binutils-2.17/sys/vm/vm_page.c
  projects/binutils-2.17/tools/tools/ath/athpow/athpow.c
  projects/binutils-2.17/usr.sbin/newsyslog/newsyslog.8
  projects/binutils-2.17/usr.sbin/newsyslog/newsyslog.c
  projects/binutils-2.17/usr.sbin/newsyslog/newsyslog.conf.5
  projects/binutils-2.17/usr.sbin/newsyslog/pathnames.h
Directory Properties:
  projects/binutils-2.17/   (props changed)
  projects/binutils-2.17/cddl/contrib/opensolaris/   (props changed)
  projects/binutils-2.17/contrib/bind9/   (props changed)
  projects/binutils-2.17/contrib/binutils/   (props changed)
  projects/binutils-2.17/contrib/bzip2/   (props changed)
  projects/binutils-2.17/contrib/dialog/   (props changed)
  projects/binutils-2.17/contrib/ee/   (props changed)
  projects/binutils-2.17/contrib/expat/   (props changed)
  projects/binutils-2.17/contrib/file/   (props changed)
  projects/binutils-2.17/contrib/gdb/   (props changed)
  projects/binutils-2.17/contrib/gdtoa/   (props changed)
  projects/binutils-2.17/contrib/gnu-sort/   (props changed)
  projects/binutils-2.17/contrib/groff/   (props changed)
  projects/binutils-2.17/contrib/less/   (props changed)
  projects/binutils-2.17/contrib/libpcap/   (props changed)
  projects/binutils-2.17/contrib/llvm/   (props changed)
  projects/binutils-2.17/contrib/llvm/tools/clang/   (props changed)
  projects/binutils-2.17/contrib/ncurses/   (props changed)
  projects/binutils-2.17/contrib/netcat/   (props changed)
  projects/binutils-2.17/contrib/ntp/   (props changed)
  projects/binutils-2.17/contrib/one-true-awk/   (props changed)
  projects/binutils-2.17/contrib/openbsm/   (props changed)
  projects/binutils-2.17/contrib/openpam/   (props changed)
  projects/binutils-2.17/contrib/pf/   (props changed)
  projects/binutils-2.17/contrib/sendmail/   (props changed)
  projects/binutils-2.17/contrib/tcpdump/   (props changed)
  projects/binutils-2.17/contrib/tcsh/   (props changed)
  projects/binutils-2.17/contrib/top/   (props changed)
  projects/binutils-2.17/contrib/top/install-sh   (props changed)
  projects/binutils-2.17/contrib/tzcode/stdtime/   (props changed)
  projects/binutils-2.17/contrib/tzcode/zic/   (props changed)
  projects/binutils-2.17/contrib/tzdata/   (props changed)
  projects/binutils-2.17/contrib/wpa/   (props changed)
  projects/binutils-2.17/contrib/xz/   (props changed)
  projects/binutils-2.17/crypto/openssh/   (props changed)
  projects/binutils-2.17/crypto/openssl/   (props changed)
  projects/binutils-2.17/lib/libc/   (props changed)
  projects/binutils-2.17/lib/libc/stdtime/   (props changed)
  projects/binutils-2.17/lib/libutil/   (props changed)
  projects/binutils-2.17/lib/libz/   (props changed)
  projects/binutils-2.17/sbin/   (props changed)
  projects/binutils-2.17/sbin/ipfw/   (props changed)
  projects/binutils-2.17/share/mk/bsd.arch.inc.mk   (props changed)
  projects/binutils-2.17/share/zoneinfo/   (props changed)
  projects/binutils-2.17/sys/   (props changed)
  projects/binutils-2.17/sys/amd64/include/xen/   (props changed)
  projects/binutils-2.17/sys/cddl/contrib/opensolaris/   (props changed)
  projects/binutils-2.17/sys/contrib/dev/acpica/   (props changed)
  projects/binutils-2.17/sys/contrib/octeon-sdk/   (props changed)
  projects/binutils-2.17/sys/contrib/pf/   (props changed)
  projects/binutils-2.17/sys/contrib/x86emu/   (props changed)
  projects/binutils-2.17/usr.bin/calendar/   (props changed)
  projects/binutils-2.17/usr.bin/csup/   (props changed)
  projects/binutils-2.17/usr.bin/procstat/   (props changed)
  projects/binutils-2.17/usr.sbin/zic/   (props changed)

Modified: projects/binutils-2.17/Makefile
==============================================================================
--- projects/binutils-2.17/Makefile	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/Makefile	Wed Feb  2 19:20:20 2011	(r218200)
@@ -126,6 +126,38 @@ BINMAKE= \
 	-m ${.CURDIR}/share/mk
 _MAKE=	PATH=${PATH} ${BINMAKE} -f Makefile.inc1
 
+# Guess machine architecture from machine type, and vice versa.
+.if !defined(TARGET_ARCH) && defined(TARGET)
+_TARGET_ARCH=	${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/}
+.elif !defined(TARGET) && defined(TARGET_ARCH) && \
+    ${TARGET_ARCH} != ${MACHINE_ARCH}
+_TARGET=		${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/}
+.endif
+# Legacy names, for a transition period mips:mips -> mipsel:mips
+.if defined(TARGET) && defined(TARGET_ARCH) && \
+    ${TARGET_ARCH} == "mips" && ${TARGET} == "mips"
+.warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb"
+.if defined(TARGET_BIG_ENDIAN)
+_TARGET_ARCH=mipseb
+.else
+_TARGET_ARCH=mipsel
+.endif
+.endif
+# arm with TARGET_BIG_ENDIAN -> armeb
+.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
+.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated.  use armeb"
+_TARGET_ARCH=armeb
+.endif
+.if defined(TARGET) && !defined(_TARGET)
+_TARGET=${TARGET}
+.endif
+.if defined(TARGET_ARCH) && !defined(_TARGET_ARCH)
+_TARGET_ARCH=${TARGET_ARCH}
+.endif
+# Otherwise, default to current machine type and architecture.
+_TARGET?=	${MACHINE}
+_TARGET_ARCH?=	${MACHINE_ARCH}
+
 #
 # Make sure we have an up-to-date make(1). Only world and buildworld
 # should do this as those are the initial targets used for upgrades.
@@ -173,8 +205,7 @@ cleanworld:
 #
 
 ${TGTS}:
-	${_+_}@cd ${.CURDIR}; \
-		${_MAKE} ${.TARGET}
+	${_+_}cd ${.CURDIR}; ${_MAKE} TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} ${.TARGET}
 
 # Set a reasonable default
 .MAIN:	all

Modified: projects/binutils-2.17/Makefile.inc1
==============================================================================
--- projects/binutils-2.17/Makefile.inc1	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/Makefile.inc1	Wed Feb  2 19:20:20 2011	(r218200)
@@ -116,32 +116,6 @@ VERSION!=	uname -srp
 VERSION+=	${OSRELDATE}
 .endif
 
-# Guess machine architecture from machine type, and vice versa.
-.if !defined(TARGET_ARCH) && defined(TARGET)
-TARGET_ARCH=	${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/}
-.elif !defined(TARGET) && defined(TARGET_ARCH) && \
-    ${TARGET_ARCH} != ${MACHINE_ARCH}
-TARGET=		${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/}
-.endif
-# Legacy names, for a transition period mips:mips -> mipsel:mips
-.if defined(TARGET) && defined(TARGET_ARCH) && \
-    ${TARGET_ARCH} == "mips" && ${TARGET} == "mips"
-.warning "TARGET_ARCH of mips is deprecated in favor of mipsel or mipseb"
-.if defined(TARGET_BIG_ENDIAN)
-TARGET_ARCH=mipseb
-.else
-TARGET_ARCH=mipsel
-.endif
-.endif
-# arm with TARGET_BIG_ENDIAN -> armeb
-.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
-.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated.  use armeb"
-TARGET_ARCH=armeb
-.endif
-# Otherwise, default to current machine type and architecture.
-TARGET?=	${MACHINE}
-TARGET_ARCH?=	${MACHINE_ARCH}
-
 KNOWN_ARCHES?=	amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips mips64el/mips mips64eb/mips mipsn32el/mips mipsn32eb/mips powerpc powerpc64/powerpc sparc64 sparc64/sun4v
 .if ${TARGET} == ${TARGET_ARCH}
 _t=		${TARGET}

Modified: projects/binutils-2.17/bin/sh/jobs.c
==============================================================================
--- projects/binutils-2.17/bin/sh/jobs.c	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/bin/sh/jobs.c	Wed Feb  2 19:20:20 2011	(r218200)
@@ -1056,13 +1056,13 @@ dowait(int block, struct job *job)
 			}
 		if (sig > 0 && sig != SIGINT && sig != SIGPIPE) {
 			if (sig < sys_nsig && sys_siglist[sig])
-				out1str(sys_siglist[sig]);
+				out2str(sys_siglist[sig]);
 			else
-				out1fmt("Signal %d", sig);
+				outfmt(out2, "Signal %d", sig);
 			if (coredump)
-				out1str(" (core dumped)");
-			out1c('\n');
-			flushout(out1);
+				out2str(" (core dumped)");
+			out2c('\n');
+			flushout(out2);
 		}
 	} else {
 		TRACE(("Not printing status, rootshell=%d, job=%p\n", rootshell, job));

Modified: projects/binutils-2.17/contrib/top/display.c
==============================================================================
--- projects/binutils-2.17/contrib/top/display.c	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/contrib/top/display.c	Wed Feb  2 19:20:20 2011	(r218200)
@@ -447,12 +447,14 @@ for (cpu = 0; cpu < num_cpus; cpu++) {
     /* print tag and bump lastline */
     if (num_cpus == 1)
 	printf("\nCPU: ");
-    else
-	printf("\nCPU %d: ", cpu);
+    else {
+	value = printf("\nCPU %d: ", cpu);
+	while (value++ <= cpustates_column)
+		printf(" ");
+    }
     lastline++;
 
     /* now walk thru the names and print the line */
-    Move_to(cpustates_column, y_cpustates + cpu);
     while ((thisname = *names++) != NULL)
     {
 	if (*thisname != '\0')
@@ -532,7 +534,7 @@ z_cpustates()
     register char **names;
     register char *thisname;
     register int *lp;
-    int cpu;
+    int cpu, value;
 
 for (cpu = 0; cpu < num_cpus; cpu++) {
     names = cpustate_names;
@@ -540,11 +542,13 @@ for (cpu = 0; cpu < num_cpus; cpu++) {
     /* show tag and bump lastline */
     if (num_cpus == 1)
 	printf("\nCPU: ");
-    else
-	printf("\nCPU %d: ", cpu);
+    else {
+	value = printf("\nCPU %d: ", cpu);
+	while (value++ <= cpustates_column)
+		printf(" ");
+    }
     lastline++;
 
-    Move_to(cpustates_column, y_cpustates + cpu);
     while ((thisname = *names++) != NULL)
     {
 	if (*thisname != '\0')

Modified: projects/binutils-2.17/contrib/tzdata/australasia
==============================================================================
--- projects/binutils-2.17/contrib/tzdata/australasia	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/contrib/tzdata/australasia	Wed Feb  2 19:20:20 2011	(r218200)
@@ -1,5 +1,5 @@
 # <pre>
-# @(#)australasia	8.20
+# @(#)australasia	8.22
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -84,14 +84,13 @@ Rule	AS	1986	only	-	Oct	19	2:00s	1:00	-
 Rule	AS	1987	2007	-	Oct	lastSun	2:00s	1:00	-
 Rule	AS	1972	only	-	Feb	27	2:00s	0	-
 Rule	AS	1973	1985	-	Mar	Sun>=1	2:00s	0	-
-Rule	AS	1986	1989	-	Mar	Sun>=15	2:00s	0	-
-Rule	AS	1990	only	-	Mar	Sun>=18	2:00s	0	-
-Rule	AS	1991	only	-	Mar	Sun>=1	2:00s	0	-
-Rule	AS	1992	only	-	Mar	Sun>=18	2:00s	0	-
-Rule	AS	1993	only	-	Mar	Sun>=1	2:00s	0	-
-Rule	AS	1994	only	-	Mar	Sun>=18	2:00s	0	-
+Rule	AS	1986	1990	-	Mar	Sun>=15	2:00s	0	-
+Rule	AS	1991	only	-	Mar	3	2:00s	0	-
+Rule	AS	1992	only	-	Mar	22	2:00s	0	-
+Rule	AS	1993	only	-	Mar	7	2:00s	0	-
+Rule	AS	1994	only	-	Mar	20	2:00s	0	-
 Rule	AS	1995	2005	-	Mar	lastSun	2:00s	0	-
-Rule	AS	2006	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	AS	2006	only	-	Apr	2	2:00s	0	-
 Rule	AS	2007	only	-	Mar	lastSun	2:00s	0	-
 Rule	AS	2008	max	-	Apr	Sun>=1	2:00s	0	-
 Rule	AS	2008	max	-	Oct	Sun>=1	2:00s	1:00	-

Modified: projects/binutils-2.17/contrib/tzdata/northamerica
==============================================================================
--- projects/binutils-2.17/contrib/tzdata/northamerica	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/contrib/tzdata/northamerica	Wed Feb  2 19:20:20 2011	(r218200)
@@ -1,5 +1,5 @@
 # <pre>
-# @(#)northamerica	8.34
+# %W%
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -471,20 +471,50 @@ Zone America/Adak	 12:13:21 -	LMT	1867 O
 #  three votes for and one against."
 
 # Hawaii
-#
-# From Arthur David Olson:
-# And then there's Hawaii.
-# DST was observed for one day in 1933;
-# standard time was changed by half an hour in 1947;
-# it's always standard as of 1986.
-#
-# From Paul Eggert:
-# Shanks says the 1933 experiment lasted for three weeks.  Go with Shanks.
-#
-Zone Pacific/Honolulu	-10:31:26 -	LMT	1900 Jan  1 12:00
-			-10:30	-	HST	1933 Apr 30 2:00
-			-10:30	1:00	HDT	1933 May 21 2:00
-			-10:30	US	H%sT	1947 Jun  8 2:00
+
+# From Arthur David Olson (2010-12-09):
+# "Hawaiian Time" by Robert C. Schmitt and Doak C. Cox appears on pages 207-225
+# of volume 26 of The Hawaiian Journal of History (1992). As of 2010-12-09,
+# the article is available at
+# <a href="http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf">;
+# http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
+# </a>
+# and indicates that standard time was adopted effective noon, January
+# 13, 1896 (page 218), that in "1933, the Legislature decreed daylight
+# saving for the period between the last Sunday of each April and the
+# last Sunday of each September, but less than a month later repealed the
+# act," (page 220), that year-round daylight saving time was in effect
+# from 1942-02-09 to 1945-09-30 (page 221, with no time of day given for
+# when clocks changed) and that clocks were changed by 30 minutes
+# effective the second Sunday of June, 1947 (page 219, with no time of
+# day given for when clocks changed). A footnote for the 1933 changes
+# cites Session Laws of Hawaii 1933, "Act. 90 (approved 26 Apr. 1933)
+# and Act 163 (approved 21 May 1933)."
+
+# From Arthur David Olson (2011-01-19):
+# The following is from "Laws of the Territory of Hawaii Passed by the
+# Seventeenth Legislature: Regular Session 1933," available (as of
+# 2011-01-19) at American University's Pence Law Library. Page 85: "Act
+# 90...At 2 o'clock ante meridian of the last Sunday in April of each
+# year, the standard time of this Territory shall be advanced one
+# hour...This Act shall take effect upon its approval. Approved this 26th
+# day of April, A. D. 1933. LAWRENCE M JUDD, Governor of the Territory of
+# Hawaii." Page 172:  "Act 163...Act 90 of the Session Laws of 1933 is
+# hereby repealed...This Act shall take effect upon its approval, upon
+# which date the standard time of this Territory shall be restored to
+# that existing immediately prior to the taking effect of said Act 90.
+# Approved this 21st day of May, A. D. 1933. LAWRENCE M. JUDD, Governor
+# of the Territory of Hawaii."
+#
+# Note that 1933-05-21 was a Sunday.
+# We're left to guess the time of day when Act 163 was approved; guess noon.
+
+Zone Pacific/Honolulu	-10:31:26 -	LMT	1896 Jan 13 12:00 #Schmitt&Cox
+			-10:30	-	HST	1933 Apr 30 2:00 #Laws 1933
+			-10:30	1:00	HDT	1933 May 21 12:00 #Laws 1933+12
+			-10:30	-	HST	1942 Feb 09 2:00 #Schmitt&Cox+2
+			-10:30	1:00	HDT	1945 Sep 30 2:00 #Schmitt&Fox+2
+			-10:30	US	H%sT	1947 Jun  8 2:00 #Schmitt&Fox+2
 			-10:00	-	HST
 
 # Now we turn to US areas that have diverged from the consensus since 1970.

Modified: projects/binutils-2.17/etc/ftpusers
==============================================================================
--- projects/binutils-2.17/etc/ftpusers	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/etc/ftpusers	Wed Feb  2 19:20:20 2011	(r218200)
@@ -20,6 +20,7 @@ _dhcp
 uucp
 pop
 www
+hast
 nobody
 mailnull
 smmsp

Modified: projects/binutils-2.17/etc/group
==============================================================================
--- projects/binutils-2.17/etc/group	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/etc/group	Wed Feb  2 19:20:20 2011	(r218200)
@@ -27,5 +27,6 @@ dialer:*:68:
 network:*:69:
 audit:*:77:
 www:*:80:
+hast:*:845:
 nogroup:*:65533:
 nobody:*:65534:

Modified: projects/binutils-2.17/etc/mail/aliases
==============================================================================
--- projects/binutils-2.17/etc/mail/aliases	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/etc/mail/aliases	Wed Feb  2 19:20:20 2011	(r218200)
@@ -30,6 +30,7 @@ bin:	root
 bind:	root
 daemon:	root
 games:	root
+hast:	root
 kmem:	root
 mailnull: postmaster
 man:	root

Modified: projects/binutils-2.17/etc/master.passwd
==============================================================================
--- projects/binutils-2.17/etc/master.passwd	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/etc/master.passwd	Wed Feb  2 19:20:20 2011	(r218200)
@@ -20,4 +20,5 @@ _dhcp:*:65:65::0:0:dhcp programs:/var/em
 uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
 pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin
 www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
+hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin
 nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin

Modified: projects/binutils-2.17/etc/rc.d/rpcbind
==============================================================================
--- projects/binutils-2.17/etc/rc.d/rpcbind	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/etc/rc.d/rpcbind	Wed Feb  2 19:20:20 2011	(r218200)
@@ -13,5 +13,7 @@ name="rpcbind"
 rcvar=`set_rcvar`
 command="/usr/sbin/${name}"
 
+stop_postcmd='/bin/rm -f /var/run/rpcbind.*'
+
 load_rc_config $name
 run_rc_command "$1"

Modified: projects/binutils-2.17/gnu/lib/libgomp/Makefile
==============================================================================
--- projects/binutils-2.17/gnu/lib/libgomp/Makefile	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/gnu/lib/libgomp/Makefile	Wed Feb  2 19:20:20 2011	(r218200)
@@ -47,14 +47,14 @@ gstdint.h:
 CLEANFILES+= gstdint.h
 
 .for HFILE in libgomp_f.h omp.h omp_lib.h
-${HFILE}: ${SRCDIR}/${HFILE}.in
+${HFILE}: ${SRCDIR}/${HFILE}.in ${.CURDIR}/Makefile
 	sed -e 's/@OMP_LOCK_ALIGN@/${OMP_LOCK_ALIGN}/g' \
 	    -e 's/@OMP_LOCK_KIND@/${OMP_LOCK_KIND}/g' \
 	    -e 's/@OMP_LOCK_SIZE@/${OMP_LOCK_SIZE}/g' \
 	    -e 's/@OMP_NEST_LOCK_ALIGN@/${OMP_NEST_LOCK_ALIGN}/g' \
 	    -e 's/@OMP_NEST_LOCK_KIND@/${OMP_NEST_LOCK_KIND}/g' \
 	    -e 's/@OMP_NEST_LOCK_SIZE@/${OMP_NEST_LOCK_SIZE}/g' \
-	    < ${.ALLSRC} > ${.TARGET}
+	    < ${SRCDIR}/${HFILE}.in > ${.TARGET}
 CLEANFILES+= ${HFILE}
 .endfor
 

Modified: projects/binutils-2.17/lib/csu/mips/crt1.c
==============================================================================
--- projects/binutils-2.17/lib/csu/mips/crt1.c	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/lib/csu/mips/crt1.c	Wed Feb  2 19:20:20 2011	(r218200)
@@ -83,7 +83,7 @@ __start(char **ap,
 	argv = ap + 1;
 	env  = ap + 2 + argc;
 	environ = env;
-	if(argc > 0 && argv[0] != NULL) {
+	if (argc > 0 && argv[0] != NULL) {
 		const char *s;
 		__progname = argv[0];
 		for (s = __progname; *s != '\0'; s++)

Modified: projects/binutils-2.17/lib/libkvm/kvm.c
==============================================================================
--- projects/binutils-2.17/lib/libkvm/kvm.c	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/lib/libkvm/kvm.c	Wed Feb  2 19:20:20 2011	(r218200)
@@ -454,11 +454,11 @@ again:
 			p->n_other = 0;
 			p->n_desc = 0;
 			if (_kvm_vnet_initialized(kd, initialize) &&
-			    !strcmp(prefix, VNET_SYMPREFIX) == 0)
+			    strcmp(prefix, VNET_SYMPREFIX) == 0)
 				p->n_value =
 				    _kvm_vnet_validaddr(kd, lookup.symvalue);
 			else if (_kvm_dpcpu_initialized(kd, initialize) &&
-			    !strcmp(prefix, DPCPU_SYMPREFIX) == 0)
+			    strcmp(prefix, DPCPU_SYMPREFIX) == 0)
 				p->n_value =
 				    _kvm_dpcpu_validaddr(kd, lookup.symvalue);
 			else

Modified: projects/binutils-2.17/lib/liblzma/config.h
==============================================================================
--- projects/binutils-2.17/lib/liblzma/config.h	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/lib/liblzma/config.h	Wed Feb  2 19:20:20 2011	(r218200)
@@ -66,7 +66,6 @@
 #define SIZEOF_SIZE_T 8
 #define STDC_HEADERS 1
 #define TUKLIB_CPUCORES_SYSCTL 1
-#define TUKLIB_FAST_UNALIGNED_ACCESS 1
 #define TUKLIB_PHYSMEM_SYSCONF 1
 #ifndef _ALL_SOURCE
 # define _ALL_SOURCE 1

Modified: projects/binutils-2.17/libexec/rtld-elf/rtld.c
==============================================================================
--- projects/binutils-2.17/libexec/rtld-elf/rtld.c	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/libexec/rtld-elf/rtld.c	Wed Feb  2 19:20:20 2011	(r218200)
@@ -93,7 +93,6 @@ static void *fill_search_info(const char
 static char *find_library(const char *, const Obj_Entry *);
 static const char *gethints(void);
 static void init_dag(Obj_Entry *);
-static void init_dag1(Obj_Entry *, Obj_Entry *, DoneList *);
 static void init_rtld(caddr_t, Elf_Auxinfo **);
 static void initlist_add_neededs(Needed_Entry *, Objlist *);
 static void initlist_add_objects(Obj_Entry *, Obj_Entry **, Objlist *);
@@ -1331,28 +1330,33 @@ gethints(void)
 static void
 init_dag(Obj_Entry *root)
 {
+    const Needed_Entry *needed;
+    const Objlist_Entry *elm;
     DoneList donelist;
 
     if (root->dag_inited)
 	return;
     donelist_init(&donelist);
-    init_dag1(root, root, &donelist);
-    root->dag_inited = true;
-}
-
-static void
-init_dag1(Obj_Entry *root, Obj_Entry *obj, DoneList *dlp)
-{
-    const Needed_Entry *needed;
 
-    if (donelist_check(dlp, obj))
-	return;
+    /* Root object belongs to own DAG. */
+    objlist_push_tail(&root->dldags, root);
+    objlist_push_tail(&root->dagmembers, root);
+    donelist_check(&donelist, root);
 
-    objlist_push_tail(&obj->dldags, root);
-    objlist_push_tail(&root->dagmembers, obj);
-    for (needed = obj->needed;  needed != NULL;  needed = needed->next)
-	if (needed->obj != NULL)
-	    init_dag1(root, needed->obj, dlp);
+    /*
+     * Add dependencies of root object to DAG in breadth order
+     * by exploiting the fact that each new object get added
+     * to the tail of the dagmembers list.
+     */
+    STAILQ_FOREACH(elm, &root->dagmembers, link) {
+	for (needed = elm->obj->needed; needed != NULL; needed = needed->next) {
+	    if (needed->obj == NULL || donelist_check(&donelist, needed->obj))
+		continue;
+	    objlist_push_tail(&needed->obj->dldags, root);
+	    objlist_push_tail(&root->dagmembers, needed->obj);
+	}
+    }
+    root->dag_inited = true;
 }
 
 /*
@@ -2320,32 +2324,28 @@ do_dlsym(void *handle, const char *name,
 
 	donelist_init(&donelist);
 	if (obj->mainprog) {
-	    /* Search main program and all libraries loaded by it. */
-	    res = symlook_list(&req, &list_main, &donelist);
+            /* Handle obtained by dlopen(NULL, ...) implies global scope. */
+	    res = symlook_global(&req, &donelist);
 	    if (res == 0) {
 		def = req.sym_out;
 		defobj = req.defobj_out;
-	    } else {
-		/*
-		 * We do not distinguish between 'main' object and
-		 * global scope.  If symbol is not defined by objects
-		 * loaded at startup, continue search among
-		 * dynamically loaded objects with RTLD_GLOBAL scope.
-		 */
-		res = symlook_list(&req, &list_global, &donelist);
+	    }
+	    /*
+	     * Search the dynamic linker itself, and possibly resolve the
+	     * symbol from there.  This is how the application links to
+	     * dynamic linker services such as dlopen.
+	     */
+	    if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) {
+		res = symlook_obj(&req, &obj_rtld);
 		if (res == 0) {
 		    def = req.sym_out;
 		    defobj = req.defobj_out;
 		}
 	    }
-	} else {
-	    Needed_Entry fake;
-
+	}
+	else {
 	    /* Search the whole DAG rooted at the given object. */
-	    fake.next = NULL;
-	    fake.obj = (Obj_Entry *)obj;
-	    fake.name = 0;
-	    res = symlook_needed(&req, &fake, &donelist);
+	    res = symlook_list(&req, &obj->dagmembers, &donelist);
 	    if (res == 0) {
 		def = req.sym_out;
 		defobj = req.defobj_out;
@@ -2960,53 +2960,33 @@ symlook_list(SymLook *req, const Objlist
 }
 
 /*
- * Search the symbol table of a shared object and all objects needed
- * by it for a symbol of the given name.  Search order is
- * breadth-first.  Returns a pointer to the symbol, or NULL if no
- * definition was found.
+ * Search the chain of DAGS cointed to by the given Needed_Entry
+ * for a symbol of the given name.  Each DAG is scanned completely
+ * before advancing to the next one.  Returns a pointer to the symbol,
+ * or NULL if no definition was found.
  */
 static int
 symlook_needed(SymLook *req, const Needed_Entry *needed, DoneList *dlp)
 {
-    const Elf_Sym *def, *def_w;
+    const Elf_Sym *def;
     const Needed_Entry *n;
-    const Obj_Entry *defobj, *defobj1;
+    const Obj_Entry *defobj;
     SymLook req1;
     int res;
 
-    def = def_w = NULL;
+    def = NULL;
     defobj = NULL;
     symlook_init_from_req(&req1, req);
     for (n = needed; n != NULL; n = n->next) {
-	if (n->obj == NULL || donelist_check(dlp, n->obj) ||
-	    (res = symlook_obj(&req1, n->obj)) != 0)
+	if (n->obj == NULL ||
+	    (res = symlook_list(&req1, &n->obj->dagmembers, dlp)) != 0)
 	    continue;
-	def = req1.sym_out;
-	defobj = req1.defobj_out;
-	if (ELF_ST_BIND(def->st_info) != STB_WEAK) {
-	    req->defobj_out = defobj;
-	    req->sym_out = def;
-	    return (0);
-	}
-    }
-    /*
-     * There we come when either symbol definition is not found in
-     * directly needed objects, or found symbol is weak.
-     */
-    for (n = needed; n != NULL; n = n->next) {
-	if (n->obj == NULL)
-	    continue;
-	res = symlook_needed(&req1, n->obj->needed, dlp);
-	if (res != 0)
-	    continue;
-	def_w = req1.sym_out;
-	defobj1 = req1.defobj_out;
-	if (def == NULL || ELF_ST_BIND(def_w->st_info) != STB_WEAK) {
-	    def = def_w;
-	    defobj = defobj1;
+	if (def == NULL || ELF_ST_BIND(req1.sym_out->st_info) != STB_WEAK) {
+	    def = req1.sym_out;
+	    defobj = req1.defobj_out;
+	    if (ELF_ST_BIND(def->st_info) != STB_WEAK)
+		break;
 	}
-	if (ELF_ST_BIND(def_w->st_info) != STB_WEAK)
-	    break;
     }
     if (def != NULL) {
 	req->sym_out = def;
@@ -3724,10 +3704,17 @@ locate_dependency(const Obj_Entry *obj, 
     }
 
     for (needed = obj->needed;  needed != NULL;  needed = needed->next) {
-	if (needed->obj == NULL)
-	    continue;
-	if (object_match_name(needed->obj, name))
-	    return needed->obj;
+	if (strcmp(obj->strtab + needed->name, name) == 0 ||
+	  (needed->obj != NULL && object_match_name(needed->obj, name))) {
+	    /*
+	     * If there is DT_NEEDED for the name we are looking for,
+	     * we are all set.  Note that object might not be found if
+	     * dependency was not loaded yet, so the function can
+	     * return NULL here.  This is expected and handled
+	     * properly by the caller.
+	     */
+	    return (needed->obj);
+	}
     }
     _rtld_error("%s: Unexpected inconsistency: dependency %s not found",
 	obj->path, name);
@@ -3853,6 +3840,8 @@ rtld_verify_object_versions(Obj_Entry *o
     vn = obj->verneed;
     while (vn != NULL) {
 	depobj = locate_dependency(obj, obj->strtab + vn->vn_file);
+	if (depobj == NULL)
+	    return (-1);
 	vna = (const Elf_Vernaux *) ((char *)vn + vn->vn_aux);
 	for (;;) {
 	    if (check_object_provided_version(obj, depobj, vna))

Modified: projects/binutils-2.17/sbin/hastd/hast.h
==============================================================================
--- projects/binutils-2.17/sbin/hastd/hast.h	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/sbin/hastd/hast.h	Wed Feb  2 19:20:20 2011	(r218200)
@@ -81,6 +81,7 @@
 #define	HIO_FLUSH		4
 #define	HIO_KEEPALIVE		5
 
+#define	HAST_USER	"hast"
 #define	HAST_TIMEOUT	5
 #define	HAST_CONFIG	"/etc/hast.conf"
 #define	HAST_CONTROL	"/var/run/hastctl"

Modified: projects/binutils-2.17/sbin/hastd/hastd.c
==============================================================================
--- projects/binutils-2.17/sbin/hastd/hastd.c	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/sbin/hastd/hastd.c	Wed Feb  2 19:20:20 2011	(r218200)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2009-2010 The FreeBSD Foundation
- * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
+ * Copyright (c) 2010-2011 Pawel Jakub Dawidek <pjd@FreeBSD.org>
  * All rights reserved.
  *
  * This software was developed by Pawel Jakub Dawidek under sponsorship from
@@ -34,9 +34,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/linker.h>
 #include <sys/module.h>
+#include <sys/stat.h>
 #include <sys/wait.h>
 
-#include <assert.h>
 #include <err.h>
 #include <errno.h>
 #include <libutil.h>
@@ -93,6 +93,172 @@ g_gate_load(void)
 	}
 }
 
+void
+descriptors_cleanup(struct hast_resource *res)
+{
+	struct hast_resource *tres;
+
+	TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) {
+		if (tres == res) {
+			PJDLOG_VERIFY(res->hr_role == HAST_ROLE_SECONDARY ||
+			    (res->hr_remotein == NULL &&
+			     res->hr_remoteout == NULL));
+			continue;
+		}
+		if (tres->hr_remotein != NULL)
+			proto_close(tres->hr_remotein);
+		if (tres->hr_remoteout != NULL)
+			proto_close(tres->hr_remoteout);
+	}
+	if (cfg->hc_controlin != NULL)
+		proto_close(cfg->hc_controlin);
+	proto_close(cfg->hc_controlconn);
+	proto_close(cfg->hc_listenconn);
+	(void)pidfile_close(pfh);
+	hook_fini();
+	pjdlog_fini();
+}
+
+static const char *
+dtype2str(mode_t mode)
+{
+
+	if (S_ISBLK(mode))
+		return ("block device");
+	else if (S_ISCHR(mode)) 
+		return ("character device");
+	else if (S_ISDIR(mode)) 
+		return ("directory");
+	else if (S_ISFIFO(mode))
+		return ("pipe or FIFO");
+	else if (S_ISLNK(mode)) 
+		return ("symbolic link");
+	else if (S_ISREG(mode)) 
+		return ("regular file");
+	else if (S_ISSOCK(mode))
+		return ("socket");
+	else if (S_ISWHT(mode)) 
+		return ("whiteout");
+	else
+		return ("unknown");
+}
+
+void
+descriptors_assert(const struct hast_resource *res, int pjdlogmode)
+{
+	char msg[256];
+	struct stat sb;
+	long maxfd;
+	bool isopen;
+	mode_t mode;
+	int fd;
+
+	/*
+	 * At this point descriptor to syslog socket is closed, so if we want
+	 * to log assertion message, we have to first store it in 'msg' local
+	 * buffer and then open syslog socket and log it.
+	 */
+	msg[0] = '\0';
+
+	maxfd = sysconf(_SC_OPEN_MAX);
+	if (maxfd < 0) {
+		pjdlog_errno(LOG_WARNING, "sysconf(_SC_OPEN_MAX) failed");
+		maxfd = 16384;
+	}
+	for (fd = 0; fd <= maxfd; fd++) {
+		if (fstat(fd, &sb) == 0) {
+			isopen = true;
+			mode = sb.st_mode;
+		} else if (errno == EBADF) {
+			isopen = false;
+			mode = 0;
+		} else {
+			isopen = true;	/* silence gcc */
+			mode = 0;	/* silence gcc */
+			snprintf(msg, sizeof(msg),
+			    "Unable to fstat descriptor %d: %s", fd,
+			    strerror(errno));
+		}
+		if (fd == STDIN_FILENO || fd == STDOUT_FILENO ||
+		    fd == STDERR_FILENO) {
+			if (!isopen) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (%s) is closed, but should be open.",
+				    fd, (fd == STDIN_FILENO ? "stdin" :
+				    (fd == STDOUT_FILENO ? "stdout" : "stderr")));
+				break;
+			}
+		} else if (fd == proto_descriptor(res->hr_event)) {
+			if (!isopen) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (event) is closed, but should be open.",
+				    fd);
+				break;
+			}
+			if (!S_ISSOCK(mode)) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (event) is %s, but should be %s.",
+				    fd, dtype2str(mode), dtype2str(S_IFSOCK));
+				break;
+			}
+		} else if (fd == proto_descriptor(res->hr_ctrl)) {
+			if (!isopen) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (ctrl) is closed, but should be open.",
+				    fd);
+				break;
+			}
+			if (!S_ISSOCK(mode)) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (ctrl) is %s, but should be %s.",
+				    fd, dtype2str(mode), dtype2str(S_IFSOCK));
+				break;
+			}
+		} else if (res->hr_role == HAST_ROLE_SECONDARY &&
+		    fd == proto_descriptor(res->hr_remotein)) {
+			if (!isopen) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (remote in) is closed, but should be open.",
+				    fd);
+				break;
+			}
+			if (!S_ISSOCK(mode)) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (remote in) is %s, but should be %s.",
+				    fd, dtype2str(mode), dtype2str(S_IFSOCK));
+				break;
+			}
+		} else if (res->hr_role == HAST_ROLE_SECONDARY &&
+		    fd == proto_descriptor(res->hr_remoteout)) {
+			if (!isopen) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (remote out) is closed, but should be open.",
+				    fd);
+				break;
+			}
+			if (!S_ISSOCK(mode)) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d (remote out) is %s, but should be %s.",
+				    fd, dtype2str(mode), dtype2str(S_IFSOCK));
+				break;
+			}
+		} else {
+			if (isopen) {
+				snprintf(msg, sizeof(msg),
+				    "Descriptor %d is open (%s), but should be closed.",
+				    fd, dtype2str(mode));
+				break;
+			}
+		}
+	}
+	if (msg[0] != '\0') {
+		pjdlog_init(pjdlogmode);
+		pjdlog_prefix_set("[%s] (%s) ", res->hr_name,
+		    role2str(res->hr_role));
+		PJDLOG_ABORT("%s", msg);
+	}
+}
+
 static void
 child_exit_log(unsigned int pid, int status)
 {
@@ -161,7 +327,7 @@ resource_needs_restart(const struct hast
     const struct hast_resource *res1)
 {
 
-	assert(strcmp(res0->hr_name, res1->hr_name) == 0);
+	PJDLOG_ASSERT(strcmp(res0->hr_name, res1->hr_name) == 0);
 
 	if (strcmp(res0->hr_provname, res1->hr_provname) != 0)
 		return (true);
@@ -186,9 +352,9 @@ resource_needs_reload(const struct hast_
     const struct hast_resource *res1)
 {
 
-	assert(strcmp(res0->hr_name, res1->hr_name) == 0);
-	assert(strcmp(res0->hr_provname, res1->hr_provname) == 0);
-	assert(strcmp(res0->hr_localpath, res1->hr_localpath) == 0);
+	PJDLOG_ASSERT(strcmp(res0->hr_name, res1->hr_name) == 0);
+	PJDLOG_ASSERT(strcmp(res0->hr_provname, res1->hr_provname) == 0);
+	PJDLOG_ASSERT(strcmp(res0->hr_localpath, res1->hr_localpath) == 0);
 
 	if (res0->hr_role != HAST_ROLE_PRIMARY)
 		return (false);
@@ -210,7 +376,7 @@ resource_reload(const struct hast_resour
 	struct nv *nvin, *nvout;
 	int error;
 
-	assert(res->hr_role == HAST_ROLE_PRIMARY);
+	PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY);
 
 	nvout = nv_alloc();
 	nv_add_uint8(nvout, HASTCTL_RELOAD, "cmd");
@@ -357,7 +523,7 @@ hastd_reload(void)
 			if (strcmp(cres->hr_name, nres->hr_name) == 0)
 				break;
 		}
-		assert(cres != NULL);
+		PJDLOG_ASSERT(cres != NULL);
 		if (resource_needs_restart(cres, nres)) {
 			pjdlog_info("Resource %s configuration was modified, restarting it.",
 			    cres->hr_name);
@@ -533,10 +699,10 @@ listen_accept(void)
 	 * we have to cancel those and accept the new connection.
 	 */
 	if (token == NULL) {
-		assert(res->hr_remoteout == NULL);
+		PJDLOG_ASSERT(res->hr_remoteout == NULL);
 		pjdlog_debug(1, "Initial connection from %s.", raddr);
 		if (res->hr_workerpid != 0) {
-			assert(res->hr_remotein == NULL);
+			PJDLOG_ASSERT(res->hr_remotein == NULL);
 			pjdlog_debug(1,
 			    "Worker process exists (pid=%u), stopping it.",
 			    (unsigned int)res->hr_workerpid);
@@ -676,29 +842,29 @@ main_loop(void)
 				hastd_reload();
 				break;
 			default:
-				assert(!"invalid condition");
+				PJDLOG_ABORT("Unexpected signal (%d).", signo);
 			}
 		}
 
 		/* Setup descriptors for select(2). */
 		FD_ZERO(&rfds);
 		maxfd = fd = proto_descriptor(cfg->hc_controlconn);
-		assert(fd >= 0);
+		PJDLOG_ASSERT(fd >= 0);
 		FD_SET(fd, &rfds);
 		fd = proto_descriptor(cfg->hc_listenconn);
-		assert(fd >= 0);
+		PJDLOG_ASSERT(fd >= 0);
 		FD_SET(fd, &rfds);
 		maxfd = fd > maxfd ? fd : maxfd;
 		TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) {
 			if (res->hr_event == NULL)
 				continue;
 			fd = proto_descriptor(res->hr_event);
-			assert(fd >= 0);
+			PJDLOG_ASSERT(fd >= 0);
 			FD_SET(fd, &rfds);
 			maxfd = fd > maxfd ? fd : maxfd;
 		}
 
-		assert(maxfd + 1 <= (int)FD_SETSIZE);
+		PJDLOG_ASSERT(maxfd + 1 <= (int)FD_SETSIZE);
 		ret = select(maxfd + 1, &rfds, NULL, NULL, &seltimeout);
 		if (ret == 0)
 			hook_check();
@@ -790,7 +956,7 @@ main(int argc, char *argv[])
 	}
 
 	cfg = yy_config_parse(cfgpath, true);
-	assert(cfg != NULL);
+	PJDLOG_ASSERT(cfg != NULL);
 
 	/*
 	 * Restore default actions for interesting signals in case parent

Modified: projects/binutils-2.17/sbin/hastd/hastd.h
==============================================================================
--- projects/binutils-2.17/sbin/hastd/hastd.h	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/sbin/hastd/hastd.h	Wed Feb  2 19:20:20 2011	(r218200)
@@ -43,6 +43,9 @@ extern const char *cfgpath;
 extern bool sigexit_received;
 extern struct pidfh *pfh;
 
+void descriptors_cleanup(struct hast_resource *res);
+void descriptors_assert(const struct hast_resource *res, int pjdlogmode);
+
 void hastd_primary(struct hast_resource *res);
 void hastd_secondary(struct hast_resource *res, struct nv *nvin);
 

Modified: projects/binutils-2.17/sbin/hastd/pjdlog.c
==============================================================================
--- projects/binutils-2.17/sbin/hastd/pjdlog.c	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/sbin/hastd/pjdlog.c	Wed Feb  2 19:20:20 2011	(r218200)
@@ -43,8 +43,7 @@ __FBSDID("$FreeBSD$");
 #include "pjdlog.h"
 
 static bool pjdlog_initialized = false;
-static int pjdlog_mode = PJDLOG_MODE_STD;
-static int pjdlog_debug_level = 0;
+static int pjdlog_mode, pjdlog_debug_level;
 static char pjdlog_prefix[128];
 
 void
@@ -57,6 +56,8 @@ pjdlog_init(int mode)
 	if (mode == PJDLOG_MODE_SYSLOG)
 		openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON);
 	pjdlog_mode = mode;
+	pjdlog_debug_level = 0;
+	bzero(pjdlog_prefix, sizeof(pjdlog_prefix));
 
 	pjdlog_initialized = true;
 }
@@ -436,10 +437,10 @@ pjdlog_exitx(int exitcode, const char *f
 }
 
 /*
- * Log assertion and exit.
+ * Log failure message and exit.
  */
 void
-pjdlog_verify(const char *func, const char *file, int line,
+pjdlog_abort(const char *func, const char *file, int line,
     const char *failedexpr, const char *fmt, ...)
 {
 	va_list ap;

Modified: projects/binutils-2.17/sbin/hastd/pjdlog.h
==============================================================================
--- projects/binutils-2.17/sbin/hastd/pjdlog.h	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/sbin/hastd/pjdlog.h	Wed Feb  2 19:20:20 2011	(r218200)
@@ -89,22 +89,22 @@ void pjdlogv_exit(int exitcode, const ch
 void pjdlog_exitx(int exitcode, const char *fmt, ...) __printflike(2, 3) __dead2;
 void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) __printflike(2, 0) __dead2;
 
-void pjdlog_verify(const char *func, const char *file, int line,
-    const char *failedexpr, const char *fmt, ...) __printflike(5, 6);
+void pjdlog_abort(const char *func, const char *file, int line,
+    const char *failedexpr, const char *fmt, ...) __printflike(5, 6) __dead2;
 
 #define	PJDLOG_VERIFY(expr)	do {					\
 	if (!(expr)) {							\
-		pjdlog_verify(__func__, __FILE__, __LINE__, #expr,	\
+		pjdlog_abort(__func__, __FILE__, __LINE__, #expr,	\
 		    __func__);						\
 	}								\
 } while (0)
 #define	PJDLOG_RVERIFY(expr, ...)	do {				\
 	if (!(expr)) {							\
-		pjdlog_verify(__func__, __FILE__, __LINE__, #expr,	\
+		pjdlog_abort(__func__, __FILE__, __LINE__, #expr,	\
 		    __VA_ARGS__);					\
 	}								\
 } while (0)
-#define	PJDLOG_ABORT(...)	pjdlog_verify(__func__, __FILE__,	\
+#define	PJDLOG_ABORT(...)	pjdlog_abort(__func__, __FILE__,	\
 				    __LINE__, NULL, __VA_ARGS__)
 #ifdef NDEBUG
 #define	PJDLOG_ASSERT(expr)	do { } while (0)

Modified: projects/binutils-2.17/sbin/hastd/primary.c
==============================================================================
--- projects/binutils-2.17/sbin/hastd/primary.c	Wed Feb  2 18:44:02 2011	(r218199)
+++ projects/binutils-2.17/sbin/hastd/primary.c	Wed Feb  2 19:20:20 2011	(r218200)
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
 
 #include <geom/gate/g_gate.h>
 
-#include <assert.h>
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -266,7 +265,7 @@ primary_exit(int exitcode, const char *f
 {
 	va_list ap;
 
-	assert(exitcode != EX_OK);
+	PJDLOG_ASSERT(exitcode != EX_OK);
 	va_start(ap, fmt);
 	pjdlogv_errno(LOG_ERR, fmt, ap);
 	va_end(ap);
@@ -293,8 +292,8 @@ hast_activemap_flush(struct hast_resourc
 	size_t size;
 
 	buf = activemap_bitmap(res->hr_amp, &size);
-	assert(buf != NULL);
-	assert((size % res->hr_local_sectorsize) == 0);
+	PJDLOG_ASSERT(buf != NULL);
+	PJDLOG_ASSERT((size % res->hr_local_sectorsize) == 0);
 	if (pwrite(res->hr_localfd, buf, size, METADATA_SIZE) !=
 	    (ssize_t)size) {
 		KEEP_ERRNO(pjdlog_errno(LOG_ERR,
@@ -503,8 +502,8 @@ init_remote(struct hast_resource *res, s
 	uint32_t mapsize;
 	size_t size;
 
-	assert((inp == NULL && outp == NULL) || (inp != NULL && outp != NULL));
-	assert(real_remote(res));
+	PJDLOG_ASSERT((inp == NULL && outp == NULL) || (inp != NULL && outp != NULL));
+	PJDLOG_ASSERT(real_remote(res));
 
 	in = out = NULL;
 	errmsg = NULL;
@@ -516,7 +515,7 @@ init_remote(struct hast_resource *res, s
 		    res->hr_remoteaddr);
 	}
 	/* Try to connect, but accept failure. */
-	if (proto_connect(out) < 0) {
+	if (proto_connect(out, HAST_TIMEOUT) < 0) {
 		pjdlog_errno(LOG_WARNING, "Unable to connect to %s",
 		    res->hr_remoteaddr);
 		goto close;
@@ -583,7 +582,7 @@ init_remote(struct hast_resource *res, s
 		    res->hr_remoteaddr);
 	}
 	/* Try to connect, but accept failure. */
-	if (proto_connect(in) < 0) {
+	if (proto_connect(in, HAST_TIMEOUT) < 0) {
 		pjdlog_errno(LOG_WARNING, "Unable to connect to %s",
 		    res->hr_remoteaddr);
 		goto close;

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102021920.p12JKL0x019166>