summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-09-21 19:03:25 +0000
committerdteske <dteske@FreeBSD.org>2012-09-21 19:03:25 +0000
commit5bd90f70aeb197b19ce714af4c1a59070b9dc689 (patch)
treed041ecdde663dcb11b07368b0990746b6b9decd7
parentbe9906f96c7ede292408ef02eae1e83ce8646c13 (diff)
downloadFreeBSD-src-5bd90f70aeb197b19ce714af4c1a59070b9dc689.zip
FreeBSD-src-5bd90f70aeb197b19ce714af4c1a59070b9dc689.tar.gz
Reverse SVN r240770 -- jilles@ made a suggestion that allowed us to redesign
our embedded rescue environment to support /dev/null making r240770 obsolete. Reviewed by: jilles, adrian (co-mentor) Approved by: jilles, adrian (co-mentor)
-rwxr-xr-xusr.sbin/bsdconfig/bsdconfig6
-rwxr-xr-xusr.sbin/bsdconfig/console/ttys4
-rwxr-xr-xusr.sbin/bsdconfig/mouse/enable2
-rwxr-xr-xusr.sbin/bsdconfig/networking/devices2
-rw-r--r--usr.sbin/bsdconfig/networking/share/device.subr2
-rw-r--r--usr.sbin/bsdconfig/networking/share/ipaddr.subr2
-rw-r--r--usr.sbin/bsdconfig/networking/share/media.subr2
-rw-r--r--usr.sbin/bsdconfig/networking/share/netmask.subr2
-rw-r--r--usr.sbin/bsdconfig/networking/share/resolv.subr16
-rw-r--r--usr.sbin/bsdconfig/networking/share/routing.subr2
-rw-r--r--usr.sbin/bsdconfig/share/common.subr2
-rw-r--r--usr.sbin/bsdconfig/share/dialog.subr6
-rw-r--r--usr.sbin/bsdconfig/share/mustberoot.subr12
-rw-r--r--usr.sbin/bsdconfig/share/strings.subr2
-rw-r--r--usr.sbin/bsdconfig/share/sysrc.subr22
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcadd2
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcconf6
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcdelete8
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcvar6
-rw-r--r--usr.sbin/bsdconfig/startup/share/rcconf.subr4
-rw-r--r--usr.sbin/bsdconfig/timezone/share/zones.subr2
-rw-r--r--usr.sbin/bsdconfig/usermgmt/share/user_input.subr12
22 files changed, 62 insertions, 62 deletions
diff --git a/usr.sbin/bsdconfig/bsdconfig b/usr.sbin/bsdconfig/bsdconfig
index c2a024d..ea72d3c 100755
--- a/usr.sbin/bsdconfig/bsdconfig
+++ b/usr.sbin/bsdconfig/bsdconfig
@@ -73,7 +73,7 @@ usage()
# Determine the maximum width of terminal/console
#
local max_size max_width
- max_size=$( stty size 2>&- )
+ max_size=$( stty size 2> /dev/null )
: ${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>&- |
- tail -1 )
+ sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang \
+ 2> /dev/null | tail -1 )
# Fall-back to non-i18n sources if nothing was found
[ "$sel" ] ||
diff --git a/usr.sbin/bsdconfig/console/ttys b/usr.sbin/bsdconfig/console/ttys
index 8ec55d8..fcf45ef 100755
--- a/usr.sbin/bsdconfig/console/ttys
+++ b/usr.sbin/bsdconfig/console/ttys
@@ -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>&- )"
- local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2>&- )"
+ local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2> /dev/null )"
+ local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2> /dev/null )"
f_quietly chmod "${mode:-0644}" "$tmpfile"
f_quietly chown "${owner:-root:wheel}" "$tmpfile"
diff --git a/usr.sbin/bsdconfig/mouse/enable b/usr.sbin/bsdconfig/mouse/enable
index 30f7c57..e1cf796 100755
--- a/usr.sbin/bsdconfig/mouse/enable
+++ b/usr.sbin/bsdconfig/mouse/enable
@@ -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>&- )"
+ f_quietly kill "$( cat "$MOUSED_PIDFILE" 2> /dev/null )"
f_quietly vidcontrol -m on
f_quietly moused -t "$type" -p "$port" $flags
diff --git a/usr.sbin/bsdconfig/networking/devices b/usr.sbin/bsdconfig/networking/devices
index ec55155..c7c550f 100755
--- a/usr.sbin/bsdconfig/networking/devices
+++ b/usr.sbin/bsdconfig/networking/devices
@@ -112,7 +112,7 @@ while :; do
# configuration
#
dhcp=
- eval "$( exec 2>&-
+ eval "$( exec 2> /dev/null
set -- $_ifconfig
while [ $# -gt 0 ]; do
case "$1" in
diff --git a/usr.sbin/bsdconfig/networking/share/device.subr b/usr.sbin/bsdconfig/networking/share/device.subr
index a058884..17c7467 100644
--- a/usr.sbin/bsdconfig/networking/share/device.subr
+++ b/usr.sbin/bsdconfig/networking/share/device.subr
@@ -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>&- &&
+ sysctl -n "dev.$devname.$devunit.%desc" 2> /dev/null &&
return $SUCCESS
fi
diff --git a/usr.sbin/bsdconfig/networking/share/ipaddr.subr b/usr.sbin/bsdconfig/networking/share/ipaddr.subr
index 707e981..7e858dc 100644
--- a/usr.sbin/bsdconfig/networking/share/ipaddr.subr
+++ b/usr.sbin/bsdconfig/networking/share/ipaddr.subr
@@ -47,7 +47,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
f_ifconfig_inet()
{
local interface="$1"
- ifconfig "$interface" 2>&- | awk \
+ ifconfig "$interface" 2> /dev/null | awk \
'
BEGIN { found = 0 }
( $1 == "inet" ) \
diff --git a/usr.sbin/bsdconfig/networking/share/media.subr b/usr.sbin/bsdconfig/networking/share/media.subr
index d863b3e..e7da98a 100644
--- a/usr.sbin/bsdconfig/networking/share/media.subr
+++ b/usr.sbin/bsdconfig/networking/share/media.subr
@@ -83,7 +83,7 @@ f_ifconfig_options()
f_ifconfig_media()
{
local interface="$1"
- ifconfig -m "$interface" 2>&- | awk \
+ ifconfig -m "$interface" 2> /dev/null | awk \
'
BEGIN { media_found = 0 }
{
diff --git a/usr.sbin/bsdconfig/networking/share/netmask.subr b/usr.sbin/bsdconfig/networking/share/netmask.subr
index a502dc4..2f2b378 100644
--- a/usr.sbin/bsdconfig/networking/share/netmask.subr
+++ b/usr.sbin/bsdconfig/networking/share/netmask.subr
@@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
f_ifconfig_netmask()
{
local interface="$1" octets
- octets=$( ifconfig "$interface" 2>&- | awk \
+ octets=$( ifconfig "$interface" 2> /dev/null | awk \
'
BEGIN { found = 0 }
( $1 == "inet" ) \
diff --git a/usr.sbin/bsdconfig/networking/share/resolv.subr b/usr.sbin/bsdconfig/networking/share/resolv.subr
index dc96345..154748b 100644
--- a/usr.sbin/bsdconfig/networking/share/resolv.subr
+++ b/usr.sbin/bsdconfig/networking/share/resolv.subr
@@ -65,7 +65,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
#
f_resolv_conf_domain()
{
- tail -r "$RESOLV_CONF" 2>&- | awk \
+ tail -r "$RESOLV_CONF" 2> /dev/null | awk \
'
BEGIN { found = 0 }
( tolower($1) == "domain" ) \
@@ -84,7 +84,7 @@ f_resolv_conf_domain()
#
f_resolv_conf_search()
{
- tail -r "$RESOLV_CONF" 2>&- | awk \
+ tail -r "$RESOLV_CONF" 2> /dev/null | awk \
'
BEGIN { found = 0 }
{
@@ -118,7 +118,7 @@ f_resolv_conf_nameservers()
}
END { exit ! found }
' \
- "$RESOLV_CONF" 2>&-
+ "$RESOLV_CONF" 2> /dev/null
}
# 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>&- )"
- local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- )"
+ local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )"
+ local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )"
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>&- )
+ new_contents=$( tail -r "$RESOLV_CONF" 2> /dev/null )
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>&- )
- owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- )
+ mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )
+ owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )
f_quietly chmod "${mode:-0644}" "$tmpfile"
f_quietly chown "${owner:-root:wheel}" "$tmpfile"
diff --git a/usr.sbin/bsdconfig/networking/share/routing.subr b/usr.sbin/bsdconfig/networking/share/routing.subr
index 6c03f4c..b8ccdcd 100644
--- a/usr.sbin/bsdconfig/networking/share/routing.subr
+++ b/usr.sbin/bsdconfig/networking/share/routing.subr
@@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
#
f_route_get_default()
{
- route -n get default 2>&- | awk \
+ route -n get default 2> /dev/null | awk \
'
BEGIN { found = 0 }
( $1 == "gateway:" ) \
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr
index 49d3023..c724c62 100644
--- a/usr.sbin/bsdconfig/share/common.subr
+++ b/usr.sbin/bsdconfig/share/common.subr
@@ -72,7 +72,7 @@ f_err()
#
f_quietly()
{
- "$@" >&- 2>&-
+ "$@" > /dev/null 2>&1
}
# f_have $anything ...
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index 4f86e7b..d2ba529 100644
--- a/usr.sbin/bsdconfig/share/dialog.subr
+++ b/usr.sbin/bsdconfig/share/dialog.subr
@@ -1321,7 +1321,7 @@ f_dialog_init()
# Process stored command-line arguments
#
SECURE=$( set -- "$ARGV"
- while getopts S flag >&-; do
+ while getopts S flag > /dev/null; do
case "$flag" in
S) echo 1;;
\?) continue;;
@@ -1329,7 +1329,7 @@ f_dialog_init()
done
)
USE_XDIALOG=$( set -- "$ARGV"
- while getopts SX flag >&-; do
+ while getopts SX flag > /dev/null; 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 - >&- 2>&-'
+ ~root/.Xauthority merge - > /dev/null 2>&1'
fi
#
diff --git a/usr.sbin/bsdconfig/share/mustberoot.subr b/usr.sbin/bsdconfig/share/mustberoot.subr
index 234724e..c6514c0 100644
--- a/usr.sbin/bsdconfig/share/mustberoot.subr
+++ b/usr.sbin/bsdconfig/share/mustberoot.subr
@@ -85,7 +85,7 @@ f_become_root_via_sudo()
#
# Check sudo(8) access before prompting for password.
#
- :| sudo -S -v 2>&-
+ :| sudo -S -v 2> /dev/null
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 >&- )
+ 2>&1 > /dev/null )
retval=$?
# Catch X11-related errors
@@ -141,7 +141,7 @@ f_become_root_via_sudo()
#
# Validate sudo(8) credentials
#
- sudo -S -v 2>&- <<-EOF
+ sudo -S -v 2> /dev/null <<-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 - >&- 2>&-'
+ ~root/.Xauthority merge - > /dev/null 2>&1'
fi
# Re-execute ourselves with sudo(8)
@@ -254,7 +254,7 @@ f_authenticate_some_user()
$height $width \
"$field_username" "" \
"$field_password" "" \
- 2>&1 >&- )
+ 2>&1 > /dev/null )
retval=$?
# Catch X11-related errors
@@ -302,7 +302,7 @@ f_authenticate_some_user()
su -m "$user" <<-EOF
sh <<EOS
sudo -k
- sudo -S -v 2>&- <<EOP
+ sudo -S -v 2> /dev/null <<EOP
$password
EOP
EOS
diff --git a/usr.sbin/bsdconfig/share/strings.subr b/usr.sbin/bsdconfig/share/strings.subr
index fac55fe..1a330ad 100644
--- a/usr.sbin/bsdconfig/share/strings.subr
+++ b/usr.sbin/bsdconfig/share/strings.subr
@@ -98,7 +98,7 @@ f_isinteger()
# Attempt to perform arithmetic divison (an operation which will exit
# with error unless arg is a valid positive/negative whole integer).
#
- ( : $((0/$arg)) ) >&- 2>&-
+ ( : $((0/$arg)) ) > /dev/null 2>&1
}
fi # ! $_STRINGS_SUBR
diff --git a/usr.sbin/bsdconfig/share/sysrc.subr b/usr.sbin/bsdconfig/share/sysrc.subr
index e39b67a..014ab46 100644
--- a/usr.sbin/bsdconfig/share/sysrc.subr
+++ b/usr.sbin/bsdconfig/share/sysrc.subr
@@ -134,7 +134,7 @@ f_sysrc_get()
#
f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS
- . "$RC_DEFAULTS" >&- 2>&-
+ . "$RC_DEFAULTS" > /dev/null 2>&1
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?} ) >&- 2>&-
+ ( : ${RC_CONFS?} ) > /dev/null 2>&1
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 >&- 2>&-
+ source_rc_confs > /dev/null 2>&1
#
# 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>&-
+ eval echo '"${'"$1"'}"' 2> /dev/null
)
}
@@ -221,7 +221,7 @@ f_sysrc_get_default()
#
f_clean_env --except RC_DEFAULTS
- . "$RC_DEFAULTS" >&- 2>&-
+ . "$RC_DEFAULTS" > /dev/null 2>&1
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>&-
+ eval echo '"${'"$1"'}"' 2> /dev/null
)
}
@@ -477,7 +477,7 @@ f_sysrc_set()
# permissions from the temporary file).
#
local mode
- mode=$( stat -f '%#Lp' "$file" 2>&- )
+ mode=$( stat -f '%#Lp' "$file" 2> /dev/null )
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>&- )
+ owner=$( stat -f '%u:%g' "$file" 2> /dev/null )
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>&- )
+ new_contents=$( tail -r $file 2> /dev/null )
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>&- )
- owner=$( stat -f '%u:%g' "$file" 2>&- )
+ mode=$( stat -f '%#Lp' "$file" 2> /dev/null )
+ owner=$( stat -f '%u:%g' "$file" 2> /dev/null )
f_quietly chmod "${mode:-0644}" "$tmpfile"
f_quietly chown "${owner:-root:wheel}" "$tmpfile"
diff --git a/usr.sbin/bsdconfig/startup/rcadd b/usr.sbin/bsdconfig/startup/rcadd
index ae7f9fc..d9d6a04 100755
--- a/usr.sbin/bsdconfig/startup/rcadd
+++ b/usr.sbin/bsdconfig/startup/rcadd
@@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
# Options
#
# Inherit SHOW_DESC value if set, otherwise default to 1
-( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1
+( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1
############################################################ FUNCTIONS
diff --git a/usr.sbin/bsdconfig/startup/rcconf b/usr.sbin/bsdconfig/startup/rcconf
index 1055f94..3f7c250 100755
--- a/usr.sbin/bsdconfig/startup/rcconf
+++ b/usr.sbin/bsdconfig/startup/rcconf
@@ -54,7 +54,7 @@ RCCONF_MENU_LIST=
# Options
#
# Inherit SHOW_DESC value if set, otherwise default to 1
-( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1
+( : ${SHOW_DESC?} ) > /dev/null 2>&1 || 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" >&-
- source_rc_confs >&-
+ . "$RC_DEFAULTS" > /dev/null
+ source_rc_confs > /dev/null
var_list=$( f_startup_rcconf_list )
for var in $var_list; do
eval export $var
diff --git a/usr.sbin/bsdconfig/startup/rcdelete b/usr.sbin/bsdconfig/startup/rcdelete
index a93733e..a970258 100755
--- a/usr.sbin/bsdconfig/startup/rcdelete
+++ b/usr.sbin/bsdconfig/startup/rcdelete
@@ -54,7 +54,7 @@ RCCONF_MENU_LIST=
# Options
#
# Inherit SHOW_DESC value if set, otherwise default to 1
-( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1
+( : ${SHOW_DESC?} ) > /dev/null 2>&1 || 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" >&-
- source_rc_confs >&-
+ . "$RC_DEFAULTS" > /dev/null
+ source_rc_confs > /dev/null
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?} ) >&- 2>&-; then
+ if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then
unset _${var}_delete
else
setvar _${var}_delete 1
diff --git a/usr.sbin/bsdconfig/startup/rcvar b/usr.sbin/bsdconfig/startup/rcvar
index 1917139..799dd34 100755
--- a/usr.sbin/bsdconfig/startup/rcvar
+++ b/usr.sbin/bsdconfig/startup/rcvar
@@ -54,7 +54,7 @@ RCVAR_MENU_LIST=
# Options
#
# Inherit SHOW_DESC value if set, otherwise default to 1
-( ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1
+( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1
############################################################ FUNCTIONS
@@ -82,8 +82,8 @@ dialog_menu_main()
fi
RCVAR_MENU_LIST="$RCVAR_MENU_LIST $(
- . "$RC_DEFAULTS" >&-
- source_rc_confs >&-
+ . "$RC_DEFAULTS" > /dev/null
+ source_rc_confs > /dev/null
for rcvar in $( echo "$RCVAR_MAP" | awk '{print $1}' ); do
eval export $rcvar
done
diff --git a/usr.sbin/bsdconfig/startup/share/rcconf.subr b/usr.sbin/bsdconfig/startup/share/rcconf.subr
index ef413d1..25dec54 100644
--- a/usr.sbin/bsdconfig/startup/share/rcconf.subr
+++ b/usr.sbin/bsdconfig/startup/share/rcconf.subr
@@ -63,9 +63,9 @@ STARTUP_RCCONF_MAP_CACHEFILE="/var/run/bsdconfig/startup_rcconf_map.cache"
f_startup_rcconf_list()
{
( # Operate within a sub-shell to protect the parent environment
- . "$RC_DEFAULTS" >&-
+ . "$RC_DEFAULTS" > /dev/null
f_clean_env --except PATH STARTUP_RCCONF_REGEX rc_conf_files
- source_rc_confs >&-
+ source_rc_confs > /dev/null
export _rc_conf_files_file="$( f_sysrc_find rc_conf_files )"
export RC_DEFAULTS
set | awk -F= "
diff --git a/usr.sbin/bsdconfig/timezone/share/zones.subr b/usr.sbin/bsdconfig/timezone/share/zones.subr
index f3db07c..874b272 100644
--- a/usr.sbin/bsdconfig/timezone/share/zones.subr
+++ b/usr.sbin/bsdconfig/timezone/share/zones.subr
@@ -610,7 +610,7 @@ f_install_zoneinfo()
# Save knowledge for later
if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then
- if : 2>&- > "$_PATH_DB"; then
+ if : 2> /dev/null > "$_PATH_DB"; then
cat <<-EOF > "$_PATH_DB"
$zoneinfo
EOF
diff --git a/usr.sbin/bsdconfig/usermgmt/share/user_input.subr b/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
index 7fa9d79..8b356b6 100644
--- a/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
+++ b/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
@@ -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>&- )
+ "+%d %m %Y" 2> /dev/null )
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>&- )
+ -f %s -- "$_input" "+%H %M %S" 2> /dev/null )
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>&- )
+ +%s 2> /dev/null )
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>&- )
+ "+%d %m %Y" 2> /dev/null )
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>&- )
+ -f %s -- "$_input" "+%H %M %S" 2> /dev/null )
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>&- )
+ +%s 2> /dev/null )
f_dprintf "_input=[$_input]"
break ;;
OpenPOWER on IntegriCloud