[PATCH 2/8] hwclock: move rtc permissions test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move the rtc permissions test below the systz call and
simplify it's 'if' test.

Signed-off-by: J William Piggott <elseifthen@xxxxxxx>
---
 sys-utils/hwclock.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index cec712d..ad9c502 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1037,9 +1037,6 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time,
 	/* local return code */
 	int rc = 0;
 
-	if (!ctl->systz && !ctl->predict && ur->get_permissions())
-		return EX_NOPERM;
-
 	if ((ctl->set || ctl->systohc || ctl->adjust) &&
 	    (adjtime->local_utc == UTC) != ctl->universal) {
 		adjtime->local_utc = ctl->universal ? UTC : LOCAL;
@@ -1049,6 +1046,9 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time,
 	if (ctl->systz)
 		return set_system_clock_timezone(ctl);
 
+	if (!ctl->predict && ur->get_permissions())
+		return EX_NOPERM;
+
 	if (ctl->show || ctl->get || ctl->adjust || ctl->hctosys
 	    || (!ctl->noadjfile && !ctl->predict)) {
 		/* data from HW-clock are required */
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux