summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/power_profile
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2008-06-23 22:06:28 +0000
committermtm <mtm@FreeBSD.org>2008-06-23 22:06:28 +0000
commit5b37d9eba744dee55431a0426bafd09eef483fea (patch)
tree143050b4a26dfcca36087688ac911ef3e62dfd91 /etc/rc.d/power_profile
parent437891381c13fcfea1097ae4d151f60dbcd8f601 (diff)
downloadFreeBSD-src-5b37d9eba744dee55431a0426bafd09eef483fea.zip
FreeBSD-src-5b37d9eba744dee55431a0426bafd09eef483fea.tar.gz
The sysctl(8) program exits on some errors and only emits warnings on
others. In the case where it displayed warnings it would still return succesfully. Modify it so that it returns the number of sysctls that it was not able to set. Make use of this in rc.d to display only *unsuccessfull* attempts to set sysctls.
Diffstat (limited to 'etc/rc.d/power_profile')
-rw-r--r--etc/rc.d/power_profile6
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/rc.d/power_profile b/etc/rc.d/power_profile
index 7f64b72..03d36be 100644
--- a/etc/rc.d/power_profile
+++ b/etc/rc.d/power_profile
@@ -50,7 +50,11 @@ sysctl_set ()
esac
# Set the desired value
- [ -n "${value}" ] && sysctl ${node}=${value}
+ if [ -n "${value}" ]; then
+ if ! sysctl ${node}=${value} > /dev/null 2>&1; then
+ warn "unable to set ${node}=${value}"
+ fi
+ fi
}
if [ $# -ne 1 ]; then
OpenPOWER on IntegriCloud