From owner-svn-src-all@FreeBSD.ORG Fri Sep 21 01:36:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14F9E106564A; Fri, 21 Sep 2012 01:36:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F139E8FC0A; Fri, 21 Sep 2012 01:36:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8L1aKHU032014; Fri, 21 Sep 2012 01:36:20 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8L1aKiF031991; Fri, 21 Sep 2012 01:36:20 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209210136.q8L1aKiF031991@svn.freebsd.org> From: Devin Teske Date: Fri, 21 Sep 2012 01:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 01:36:21 -0000 Author: dteske Date: Fri Sep 21 01:36:20 2012 New Revision: 240770 URL: http://svn.freebsd.org/changeset/base/240770 Log: Replace redirections to /dev/null with "close file-descriptor" syntax (>&-). Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/strings.subr head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 (r240770) @@ -73,7 +73,7 @@ usage() # Determine the maximum width of terminal/console # local max_size max_width - max_size=$( stty size 2> /dev/null ) + max_size=$( stty size 2>&- ) : ${max_size:="24 80"} max_width="${max_size#*[$IFS]}" f_dprintf "max_width=[$max_width]" @@ -242,8 +242,8 @@ if [ "$1" ]; then # lang="${LANG:-$LC_ALL}" if [ "$lang" ]; then - sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang \ - 2> /dev/null | tail -1 ) + sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang 2>&- | + tail -1 ) # Fall-back to non-i18n sources if nothing was found [ "$sel" ] || Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 01:36:20 2012 (r240770) @@ -117,8 +117,8 @@ ttys_set_type() # with 0600 permissions -- change the permissions and ownership to # match ttys(5) before we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2> /dev/null )" - local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2> /dev/null )" + local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2>&- )" + local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2>&- )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 01:36:20 2012 (r240770) @@ -86,7 +86,7 @@ flags=$( f_sysrc_get moused_flags ) # f_dialog_info "$msg_trying_to_start_the_mouse_daemon" [ -r "$MOUSED_PIDFILE" ] && - f_quietly kill "$( cat "$MOUSED_PIDFILE" 2> /dev/null )" + f_quietly kill "$( cat "$MOUSED_PIDFILE" 2>&- )" f_quietly vidcontrol -m on f_quietly moused -t "$type" -p "$port" $flags Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 01:36:20 2012 (r240770) @@ -112,7 +112,7 @@ while :; do # configuration # dhcp= - eval "$( exec 2> /dev/null + eval "$( exec 2>&- set -- $_ifconfig while [ $# -gt 0 ]; do case "$1" in Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -72,7 +72,7 @@ f_device_desc() devname="${device%%$d*}" devunit="${device#$devname}" devunit="${devunit%%[a-zA-Z_]*}" - sysctl -n "dev.$devname.$devunit.%desc" 2> /dev/null && + sysctl -n "dev.$devname.$devunit.%desc" 2>&- && return $SUCCESS fi Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -47,7 +47,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_inet() { local interface="$1" - ifconfig "$interface" 2> /dev/null | awk \ + ifconfig "$interface" 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -83,7 +83,7 @@ f_ifconfig_options() f_ifconfig_media() { local interface="$1" - ifconfig -m "$interface" 2> /dev/null | awk \ + ifconfig -m "$interface" 2>&- | awk \ ' BEGIN { media_found = 0 } { Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_netmask() { local interface="$1" octets - octets=$( ifconfig "$interface" 2> /dev/null | awk \ + octets=$( ifconfig "$interface" 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -65,7 +65,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_resolv_conf_domain() { - tail -r "$RESOLV_CONF" 2> /dev/null | awk \ + tail -r "$RESOLV_CONF" 2>&- | awk \ ' BEGIN { found = 0 } ( tolower($1) == "domain" ) \ @@ -84,7 +84,7 @@ f_resolv_conf_domain() # f_resolv_conf_search() { - tail -r "$RESOLV_CONF" 2> /dev/null | awk \ + tail -r "$RESOLV_CONF" 2>&- | awk \ ' BEGIN { found = 0 } { @@ -118,7 +118,7 @@ f_resolv_conf_nameservers() } END { exit ! found } ' \ - "$RESOLV_CONF" 2> /dev/null + "$RESOLV_CONF" 2>&- } # f_dialog_resolv_conf_update $hostname @@ -225,8 +225,8 @@ f_dialog_resolv_conf_update() # permissions and ownership to match resolv.conf(5) before # we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )" - local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )" + local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- )" + local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" @@ -246,7 +246,7 @@ f_dialog_resolv_conf_update() # local domain="${hostname#*.}" new_contents [ "$domain" = "$hostname" ] && domain= - new_contents=$( tail -r "$RESOLV_CONF" 2> /dev/null ) + new_contents=$( tail -r "$RESOLV_CONF" 2>&- ) new_contents=$( echo "$new_contents" | awk \ -v domain="$domain" \ -v search_all="${RESOLVER_SEARCH_DOMAINS_ALL:-1}" \ @@ -397,8 +397,8 @@ f_dialog_input_nameserver() # Quietly fixup permissions and ownership # local mode owner - mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null ) - owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- ) + owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_route_get_default() { - route -n get default 2> /dev/null | awk \ + route -n get default 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "gateway:" ) \ Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -72,7 +72,7 @@ f_err() # f_quietly() { - "$@" > /dev/null 2>&1 + "$@" >&- 2>&- } # f_have $anything ... Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -1321,7 +1321,7 @@ f_dialog_init() # Process stored command-line arguments # SECURE=$( set -- "$ARGV" - while getopts S flag > /dev/null; do + while getopts S flag >&-; do case "$flag" in S) echo 1;; \?) continue;; @@ -1329,7 +1329,7 @@ f_dialog_init() done ) USE_XDIALOG=$( set -- "$ARGV" - while getopts SX flag > /dev/null; do + while getopts SX flag >&-; do case "$flag" in S|X) echo 1;; \?) continue;; @@ -1372,7 +1372,7 @@ f_dialog_init() eval xauth -if \~$SUDO_USER/.Xauthority extract - \ \"\$HOSTNAME/unix:\$displaynum\" \ \"\$HOSTNAME:\$displaynum\" | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - > /dev/null 2>&1' + ~root/.Xauthority merge - >&- 2>&-' fi # Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -85,7 +85,7 @@ f_become_root_via_sudo() # # Check sudo(8) access before prompting for password. # - :| sudo -S -v 2> /dev/null + :| sudo -S -v 2>&- if [ $? -ne $SUCCESS ]; then # # sudo(8) access denied. Prompt for their password. @@ -112,7 +112,7 @@ f_become_root_via_sudo() --ok-label "$msg_ok" \ --cancel-label "$msg_cancel" \ --password --inputbox "$msg" $size \ - 2>&1 > /dev/null ) + 2>&1 >&- ) retval=$? # Catch X11-related errors @@ -141,7 +141,7 @@ f_become_root_via_sudo() # # Validate sudo(8) credentials # - sudo -S -v 2> /dev/null <<-EOF + sudo -S -v 2>&- <<-EOF $password EOF retval=$? @@ -186,7 +186,7 @@ f_become_root_via_sudo() displaynum="${DISPLAY#*:}" xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \ $HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - > /dev/null 2>&1' + ~root/.Xauthority merge - >&- 2>&-' fi # Re-execute ourselves with sudo(8) @@ -254,7 +254,7 @@ f_authenticate_some_user() $height $width \ "$field_username" "" \ "$field_password" "" \ - 2>&1 > /dev/null ) + 2>&1 >&- ) retval=$? # Catch X11-related errors @@ -302,7 +302,7 @@ f_authenticate_some_user() su -m "$user" <<-EOF sh < /dev/null <&- < /dev/null 2>&1 + ( : $((0/$arg)) ) >&- 2>&- } fi # ! $_STRINGS_SUBR Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -134,7 +134,7 @@ f_sysrc_get() # f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS - . "$RC_DEFAULTS" > /dev/null 2>&1 + . "$RC_DEFAULTS" >&- 2>&- unset RC_DEFAULTS # no longer needed @@ -153,7 +153,7 @@ f_sysrc_get() # If RC_CONFS is defined, set $rc_conf_files to an explicit # value, modifying the default behavior of source_rc_confs(). # - ( : ${RC_CONFS?} ) > /dev/null 2>&1 + ( : ${RC_CONFS?} ) >&- 2>&- if [ $? -eq ${SUCCESS:-0} ]; then rc_conf_files="$RC_CONFS" _rc_confs_set=1 @@ -162,7 +162,7 @@ f_sysrc_get() unset SUCCESS # no longer needed - source_rc_confs > /dev/null 2>&1 + source_rc_confs >&- 2>&- # # If the query was for `rc_conf_files' AND after calling @@ -190,7 +190,7 @@ f_sysrc_get() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval echo '"${'"$1"'}"' 2>&- ) } @@ -221,7 +221,7 @@ f_sysrc_get_default() # f_clean_env --except RC_DEFAULTS - . "$RC_DEFAULTS" > /dev/null 2>&1 + . "$RC_DEFAULTS" >&- 2>&- unset RC_DEFAULTS # no longer needed @@ -232,7 +232,7 @@ f_sysrc_get_default() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval echo '"${'"$1"'}"' 2>&- ) } @@ -477,7 +477,7 @@ f_sysrc_set() # permissions from the temporary file). # local mode - mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$file" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" # @@ -486,14 +486,14 @@ f_sysrc_set() # permissions (so we throw stderr into the bit-bucket). # local owner - owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) + owner=$( stat -f '%u:%g' "$file" 2>&- ) f_quietly chown "${owner:-root:wheel}" "$tmpfile" # # Operate on the matching file, replacing only the last occurrence. # local new_contents retval - new_contents=$( tail -r $file 2> /dev/null ) + new_contents=$( tail -r $file 2>&- ) new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ -v new_value="$new_value" "$f_sysrc_set_awk" ) retval=$? @@ -572,8 +572,8 @@ f_sysrc_delete() # permissions) to instead match the destination file. # local mode owner - mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) - owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$file" 2>&- ) + owner=$( stat -f '%u:%g' "$file" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_L # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -110,8 +110,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -112,8 +112,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var @@ -348,7 +348,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then + if ( eval : \${_${var}_delete?} ) >&- 2>&-; then unset _${var}_delete else setvar _${var}_delete 1 Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCVAR_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 ############################################################ FUNCTIONS @@ -82,8 +82,8 @@ dialog_menu_main() fi RCVAR_MENU_LIST="$RCVAR_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- for rcvar in $( echo "$RCVAR_MAP" | awk '{print $1}' ); do eval export $rcvar done Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -63,9 +63,9 @@ STARTUP_RCCONF_MAP_CACHEFILE="/var/run/b f_startup_rcconf_list() { ( # Operate within a sub-shell to protect the parent environment - . "$RC_DEFAULTS" > /dev/null + . "$RC_DEFAULTS" >&- f_clean_env --except PATH STARTUP_RCCONF_REGEX rc_conf_files - source_rc_confs > /dev/null + source_rc_confs >&- export _rc_conf_files_file="$( f_sysrc_find rc_conf_files )" export RC_DEFAULTS set | awk -F= " Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -610,7 +610,7 @@ f_install_zoneinfo() # Save knowledge for later if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then - if : 2> /dev/null > "$_PATH_DB"; then + if : 2>&- > "$_PATH_DB"; then cat <<-EOF > "$_PATH_DB" $zoneinfo EOF Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -627,7 +627,7 @@ f_dialog_input_change() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2> /dev/null ) + "+%d %m %Y" 2>&- ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -654,7 +654,7 @@ f_dialog_input_change() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) + -f %s -- "$_input" "+%H %M %S" 2>&- ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -682,7 +682,7 @@ f_dialog_input_change() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2> /dev/null ) + +%s 2>&- ) f_dprintf "_input=[$_input]" break ;; @@ -852,7 +852,7 @@ f_dialog_input_expire() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2> /dev/null ) + "+%d %m %Y" 2>&- ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -879,7 +879,7 @@ f_dialog_input_expire() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) + -f %s -- "$_input" "+%H %M %S" 2>&- ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -906,7 +906,7 @@ f_dialog_input_expire() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2> /dev/null ) + +%s 2>&- ) f_dprintf "_input=[$_input]" break ;;