aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-05-30 12:17:35 +0000
committerRoy Marples <roy@marples.name>2007-05-30 12:17:35 +0000
commitece3f4e6663ec0a0ed3f0b4d014b3a0fc925fede (patch)
tree5ed0c1d2388c76f21ae409b8494b38551553df96
parent8bcc145c98cc16b149a06d7aca04f22804989c5e (diff)
Only call systohw in clock when we don't have adjfile or we aren't UTC.
-rw-r--r--ChangeLog4
-rwxr-xr-xinit.d.Linux/clock35
2 files changed, 22 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index f72a37f0..76110f01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
+ 30 May 2007; Roy Marples <uberlord@gentoo.org>:
+
+ Only call systohw in clock when we don't have adjfile or we aren't UTC.
+
* baselayout-2.0.0_alpha3 (14 May 2007)
14 May 2007; Roy Marples <uberlord@gentoo.org>:
diff --git a/init.d.Linux/clock b/init.d.Linux/clock
index 596b18d2..5c891322 100755
--- a/init.d.Linux/clock
+++ b/init.d.Linux/clock
@@ -79,24 +79,25 @@ start() {
ebegin "Setting system clock using the hardware clock" "[${TBLURB}]"
if [ ${fakeit} -eq 1 ] ; then
- ret=0
+ retval=0
elif [ -x /sbin/hwclock ] ; then
- # Since hwclock always exit's with a 0, need to check its output.
- errstr="$(/sbin/hwclock ${myadj} ${myopts} 2>&1 >/dev/null)"
- errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)"
-
- if [ -n "${errstr}" ] ; then
- ewarn "${errstr}"
- ret=1
- else
- ret=0
+ # Don't call hwclock unless we need to
+ if [ "${TBLURB}" != "UTC" -o "${myadj}" != "--noadjfile" ] ; then
+ # Since hwclock always exit's with a 0, need to check its output.
+ errstr="$(/sbin/hwclock ${myadj} ${myopts} 2>&1 >/dev/null)"
+ errstr="${errstr}$(/sbin/hwclock --hctosys ${myopts} 2>&1 >/dev/null)"
+
+ if [ -n "${errstr}" ] ; then
+ ewarn "${errstr}"
+ retval=1
+ fi
+ errstr="Failed to set clock"
fi
- errstr="Failed to set clock"
else
- ret=1
+ retval=1
errstr="/sbin/hwclock not found"
fi
- eend ${ret} "${errstr}" "You will need to set the clock yourself"
+ eend ${retval} "${errstr}" "You will need to set the clock yourself"
return 0
}
@@ -111,16 +112,16 @@ stop() {
ebegin "Setting hardware clock using the system clock" "[${TBLURB}]"
if [ ${fakeit} -eq 1 ] ; then
- ret=0
+ retval=0
elif [ -x /sbin/hwclock ] ; then
[ -z "$(/sbin/hwclock --systohc ${myopts} 2>&1 >/dev/null)" ]
- ret=$?
+ retval=$?
errstr="Failed to sync clocks"
else
- ret=1
+ retval=1
errstr="/sbin/hwclock not found"
fi
- eend ${ret} "${errstr}"
+ eend ${retval} "${errstr}"
}
save() {