summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share/sysrc.subr
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 /usr.sbin/bsdconfig/share/sysrc.subr
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)
Diffstat (limited to 'usr.sbin/bsdconfig/share/sysrc.subr')
-rw-r--r--usr.sbin/bsdconfig/share/sysrc.subr22
1 files changed, 11 insertions, 11 deletions
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"
OpenPOWER on IntegriCloud