summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share/sysrc.subr
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-09-21 01:36:20 +0000
committerdteske <dteske@FreeBSD.org>2012-09-21 01:36:20 +0000
commit36137540d6046459e5a8f5403fe04c12101b75df (patch)
tree64908c3644f93810ed9501a5e081ad2a98852d45 /usr.sbin/bsdconfig/share/sysrc.subr
parentf628c47944e7370c8d8c16cdcc6f98871a48be02 (diff)
downloadFreeBSD-src-36137540d6046459e5a8f5403fe04c12101b75df.zip
FreeBSD-src-36137540d6046459e5a8f5403fe04c12101b75df.tar.gz
Replace redirections to /dev/null with "close file-descriptor" syntax (>&-).
Reviewed by: adrian (co-mentor) Approved by: 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 014ab46..e39b67a 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" > /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"
OpenPOWER on IntegriCloud