* [PATCH 1/2] hwclock: increase debug output precision
@ 2015-03-17 16:24 J William Piggott
2015-03-17 16:28 ` [PATCH 2/2] hwclock: non-root access in test mode J William Piggott
2015-03-25 8:35 ` [PATCH 1/2] hwclock: increase debug output precision Karel Zak
0 siblings, 2 replies; 3+ messages in thread
From: J William Piggott @ 2015-03-17 16:24 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
Increased the precision in debug output showing
the clock drift and the time lapsed.
Showing a clock drift of 0.0 while giving a value that the
drift factor was adjusted by makes no sense.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
sys-utils/hwclock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 52a7874..e8732b8 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1062,8 +1062,8 @@ adjust_drift_factor(struct adjtime *adjtime_p,
drift_factor = 0;
} else {
if (debug)
- printf(_("Clock drifted %.1f seconds in the past "
- "%.1f seconds\nin spite of a drift factor of "
+ printf(_("Clock drifted %f seconds in the past "
+ "%f seconds\nin spite of a drift factor of "
"%f seconds/day.\n"
"Adjusting drift factor by %f seconds/day\n"),
time_diff(nowtime, hclocktime),
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] hwclock: non-root access in test mode
2015-03-17 16:24 [PATCH 1/2] hwclock: increase debug output precision J William Piggott
@ 2015-03-17 16:28 ` J William Piggott
2015-03-25 8:35 ` [PATCH 1/2] hwclock: increase debug output precision Karel Zak
1 sibling, 0 replies; 3+ messages in thread
From: J William Piggott @ 2015-03-17 16:28 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
Allow a non-root user to call all hwclock
functions when the --test option is used.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
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 e8732b8..e1e5816 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1914,15 +1914,15 @@ int main(int argc, char **argv)
permitted = TRUE;
else {
/* program is designed to run setuid (in some situations) */
- if (set || systohc || adjust) {
+ if ((set || systohc || adjust) && !testing) {
warnx(_("Sorry, only the superuser can change "
"the Hardware Clock."));
permitted = FALSE;
- } else if (systz || hctosys) {
+ } else if ((systz || hctosys) && !testing) {
warnx(_("Sorry, only the superuser can change "
"the System Clock."));
permitted = FALSE;
- } else if (setepoch) {
+ } else if (setepoch && !testing) {
warnx(_("Sorry, only the superuser can change the "
"Hardware Clock epoch in the kernel."));
permitted = FALSE;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] hwclock: increase debug output precision
2015-03-17 16:24 [PATCH 1/2] hwclock: increase debug output precision J William Piggott
2015-03-17 16:28 ` [PATCH 2/2] hwclock: non-root access in test mode J William Piggott
@ 2015-03-25 8:35 ` Karel Zak
1 sibling, 0 replies; 3+ messages in thread
From: Karel Zak @ 2015-03-25 8:35 UTC (permalink / raw)
To: J William Piggott; +Cc: util-linux
On Tue, Mar 17, 2015 at 12:24:52PM -0400, J William Piggott wrote:
> sys-utils/hwclock.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied both patches (week ago:-), thanks
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-25 8:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 16:24 [PATCH 1/2] hwclock: increase debug output precision J William Piggott
2015-03-17 16:28 ` [PATCH 2/2] hwclock: non-root access in test mode J William Piggott
2015-03-25 8:35 ` [PATCH 1/2] hwclock: increase debug output precision Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox