* [PATCH 0/2] pull request
@ 2017-06-22 0:49 J William Piggott
2017-06-22 8:47 ` Karel Zak
0 siblings, 1 reply; 10+ messages in thread
From: J William Piggott @ 2017-06-22 0:49 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
The following changes since commit fad561b0e4b862e320b3c7b72527b09bc1b04860:
build-sys: update DISTCHECK_CONFIGURE_FLAGS (2017-06-21 15:41:21 +0200)
are available in the git repository at:
git@github.com:jwpi/util-linux.git 170618
for you to fetch changes up to 2cb89055c57143f120a404e1c00757eb1b7d41b0:
hwclock: add audit for --systz (2017-06-21 20:37:41 -0400)
----------------------------------------------------------------
J William Piggott (2):
hwclock: remove unused optstring characters
hwclock: add audit for --systz
sys-utils/hwclock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] pull request
2017-06-22 0:49 [PATCH 0/2] pull request J William Piggott
@ 2017-06-22 8:47 ` Karel Zak
0 siblings, 0 replies; 10+ messages in thread
From: Karel Zak @ 2017-06-22 8:47 UTC (permalink / raw)
To: J William Piggott; +Cc: util-linux
On Wed, Jun 21, 2017 at 08:49:56PM -0400, J William Piggott wrote:
> are available in the git repository at:
>
> git@github.com:jwpi/util-linux.git 170618
Merged, thanks.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 0/2] Pull Request
@ 2017-07-18 19:59 J William Piggott
0 siblings, 0 replies; 10+ messages in thread
From: J William Piggott @ 2017-07-18 19:59 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
The following changes since commit 78f9ecb990b994e272d9a69670b5c006e7f9fcdc:
blkid: Add dm-integrity superblock signature (2017-07-18 14:43:21 +0200)
are available in the git repository at:
git@github.com:jwpi/util-linux.git 170717
for you to fetch changes up to 8c3a4703b173408d4f2e8dd8fcabf844b0cf0146:
hwclock: fix regression from c3ae785 (2017-07-18 15:42:55 -0400)
----------------------------------------------------------------
J William Piggott (2):
hwclock: remove unused epoch_option
hwclock: fix regression from c3ae785
sys-utils/hwclock.c | 7 ++++---
sys-utils/hwclock.h | 1 -
2 files changed, 4 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 0/2] pull request
@ 2017-09-21 20:08 J William Piggott
2017-09-21 20:09 ` [PATCH 1/2] hwclock: exit bug fix and single test mode message J William Piggott
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: J William Piggott @ 2017-09-21 20:08 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
Karel, these include a minor bug fix and another change that yet again
affects hwclock's usage strings, so I thought you might want them for
the upcoming release.
If you'd rather wait until the next cycle, that is fine with me as well.
The following changes since commit 323e0668cd380b3353da03d5bd74887ab26f1ea3:
po: fix ipcrm translation error fr.po (2017-09-20 12:14:42 +0200)
are available in the git repository at:
git@github.com:jwpi/util-linux.git 170915
for you to fetch changes up to f0a0ce744573bc3b3164062bc25e8fc6ddc7d9b9:
hwclock: make debug implicit for test mode. (2017-09-21 14:53:43 -0400)
----------------------------------------------------------------
J William Piggott (2):
hwclock: exit bug fix and single test mode message
hwclock: make debug implicit for test mode.
sys-utils/hwclock.8.in | 8 +++----
sys-utils/hwclock.c | 64 ++++++++++++++++++++------------------------------
2 files changed, 29 insertions(+), 43 deletions(-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2] hwclock: exit bug fix and single test mode message
2017-09-21 20:08 [PATCH 0/2] pull request J William Piggott
@ 2017-09-21 20:09 ` J William Piggott
2017-09-21 20:10 ` [PATCH 2/2] hwclock: make debug implicit for test mode J William Piggott
2017-09-22 10:04 ` [PATCH 0/2] pull request Karel Zak
2 siblings, 0 replies; 10+ messages in thread
From: J William Piggott @ 2017-09-21 20:09 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
Bug fix: hwclock returns success when saving /etc/adjtime fails.
Remove redundant test mode messages.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
sys-utils/hwclock.c | 61 ++++++++++++++++++++---------------------------------
1 file changed, 23 insertions(+), 38 deletions(-)
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 9fa26bd0b..6a23bf2b0 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -385,9 +385,7 @@ set_hardware_clock(const struct hwclock_control *ctl, const time_t newtime)
new_broken_time.tm_hour, new_broken_time.tm_min,
new_broken_time.tm_sec, (long)newtime);
- if (ctl->testing)
- printf(_("Test mode: clock was not changed\n"));
- else
+ if (!ctl->testing)
ur->set_hardware_clock(ctl, &new_broken_time);
}
@@ -633,10 +631,7 @@ set_system_clock(const struct hwclock_control *ctl,
}
}
- if (ctl->testing) {
- printf(_
- ("Test mode: clock was not changed\n"));
- } else {
+ if (!ctl->testing) {
const struct timezone tz = { minuteswest };
if (ctl->hctosys && !ctl->universal) /* set PCIL */
@@ -787,15 +782,11 @@ calculate_adjustment(const struct hwclock_control *ctl,
* But if the contents are clean (unchanged since read from disk), don't
* bother.
*/
-static void save_adjtime(const struct hwclock_control *ctl,
+static int save_adjtime(const struct hwclock_control *ctl,
const struct adjtime *adjtime)
{
char *content; /* Stuff to write to disk file */
FILE *fp;
- int err = 0;
-
- if (!adjtime->dirty)
- return;
xasprintf(&content, "%f %ld %f\n%ld\n%s\n",
adjtime->drift_factor,
@@ -804,28 +795,22 @@ static void save_adjtime(const struct hwclock_control *ctl,
adjtime->last_calib_time,
(adjtime->local_utc == LOCAL) ? "LOCAL" : "UTC");
- if (ctl->testing) {
- if (ctl->debug){
- printf(_("Test mode: %s was not updated with:\n%s"),
- ctl->adj_file_name, content);
- }
- free(content);
- return;
+ if (ctl->debug){
+ printf(_("New %s data:\n%s"),
+ ctl->adj_file_name, content);
}
- fp = fopen(ctl->adj_file_name, "w");
- if (fp == NULL) {
- warn(_("Could not open file with the clock adjustment parameters "
- "in it (%s) for writing"), ctl->adj_file_name);
- err = 1;
- } else if (fputs(content, fp) < 0 || close_stream(fp) != 0) {
- warn(_("Could not update file with the clock adjustment "
- "parameters (%s) in it"), ctl->adj_file_name);
- err = 1;
+ if (!ctl->testing) {
+ fp = fopen(ctl->adj_file_name, "w");
+ if (fp == NULL) {
+ warn(_("cannot open %s"), ctl->adj_file_name);
+ return EXIT_FAILURE;
+ } else if (fputs(content, fp) < 0 || close_stream(fp) != 0) {
+ warn(_("cannot update %s"), ctl->adj_file_name);
+ return EXIT_FAILURE;
+ }
}
- free(content);
- if (err)
- warnx(_("Drift adjustment parameters not updated."));
+ return EXIT_SUCCESS;
}
/*
@@ -1023,8 +1008,8 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time,
} else if (ctl->hctosys) {
return set_system_clock(ctl, hclocktime);
}
- if (!ctl->noadjfile)
- save_adjtime(ctl, adjtime);
+ if (!ctl->noadjfile && adjtime->dirty)
+ return save_adjtime(ctl, adjtime);
return EXIT_SUCCESS;
}
@@ -1046,11 +1031,9 @@ manipulate_epoch(const struct hwclock_control *ctl)
} else if (ctl->setepoch) {
if (!ctl->epoch_option)
warnx(_("--epoch is required for --setepoch."));
- else if (ctl->testing)
- printf(_("Test mode: epoch was not set to %s.\n"),
- ctl->epoch_option);
- else if (set_epoch_rtc(ctl))
- warnx(_("unable to set the RTC epoch."));
+ else if (!ctl->testing)
+ if (set_epoch_rtc(ctl))
+ warnx(_("unable to set the RTC epoch."));
}
}
#endif /* __linux__ __alpha__ */
@@ -1363,6 +1346,8 @@ int main(int argc, char **argv)
adjtime.dirty = 0;
ctl.universal = hw_clock_is_utc(&ctl, adjtime);
rc = manipulate_clock(&ctl, set_time, startup_time, &adjtime);
+ if (ctl.testing)
+ puts(_("Test mode: nothing was changed."));
hwclock_exit(&ctl, rc);
return rc; /* Not reached */
}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/2] hwclock: make debug implicit for test mode.
2017-09-21 20:08 [PATCH 0/2] pull request J William Piggott
2017-09-21 20:09 ` [PATCH 1/2] hwclock: exit bug fix and single test mode message J William Piggott
@ 2017-09-21 20:10 ` J William Piggott
2017-09-22 10:04 ` [PATCH 0/2] pull request Karel Zak
2 siblings, 0 replies; 10+ messages in thread
From: J William Piggott @ 2017-09-21 20:10 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
Calling --test without --debug is not useful, so
make it implicit.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
sys-utils/hwclock.8.in | 8 ++++----
sys-utils/hwclock.c | 3 ++-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/sys-utils/hwclock.8.in b/sys-utils/hwclock.8.in
index a3cbc015e..d88feb07b 100644
--- a/sys-utils/hwclock.8.in
+++ b/sys-utils/hwclock.8.in
@@ -372,10 +372,10 @@ must be specified when using this option.
.
.TP
.B \-\-test
-Do not actually change anything on the system, i.e., the Clocks or
-adjtime file. This is useful, especially in conjunction with
-.BR \%\-\-debug ,
-in learning about the internal operations of hwclock.
+Do not actually change anything on the system, that is, the Clocks or
+.I @ADJTIME_PATH@
+.RB ( \%\-\-debug
+is implicit with this option).
.
.TP
.B \-\-update\-drift
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 6a23bf2b0..36b6204b0 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1083,7 +1083,7 @@ usage(void)
" --noadjfile do not use %1$s\n"), _PATH_ADJTIME);
printf(_(
" --adjfile <file> use an alternate file to %1$s\n"), _PATH_ADJTIME);
- puts(_(" --test dry run; use -D to view what would have happened"));
+ puts(_(" --test dry run; implies --debug"));
puts(_(" -D, --debug display more details"));
fputs(USAGE_SEPARATOR, stdout);
printf(USAGE_HELP_OPTIONS(22));
@@ -1251,6 +1251,7 @@ int main(int argc, char **argv)
break;
case OPT_TEST:
ctl.testing = 1; /* --test */
+ ctl.debug++;
break;
case OPT_DATE:
ctl.date_opt = optarg; /* --date */
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] pull request
2017-09-21 20:08 [PATCH 0/2] pull request J William Piggott
2017-09-21 20:09 ` [PATCH 1/2] hwclock: exit bug fix and single test mode message J William Piggott
2017-09-21 20:10 ` [PATCH 2/2] hwclock: make debug implicit for test mode J William Piggott
@ 2017-09-22 10:04 ` Karel Zak
2 siblings, 0 replies; 10+ messages in thread
From: Karel Zak @ 2017-09-22 10:04 UTC (permalink / raw)
To: J William Piggott; +Cc: util-linux
On Thu, Sep 21, 2017 at 04:08:46PM -0400, J William Piggott wrote:
> J William Piggott (2):
> hwclock: exit bug fix and single test mode message
> hwclock: make debug implicit for test mode.
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 0/2] Pull Request
@ 2017-11-18 21:19 J William Piggott
2017-11-20 11:08 ` Karel Zak
0 siblings, 1 reply; 10+ messages in thread
From: J William Piggott @ 2017-11-18 21:19 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
The following changes since commit 75f03badd7ed9f1dd951863d75e756883d3acc55:
bash-completion: (umount) use findmnt, escape a space in paths (2017-11-16 16:27:32 +0100)
are available in the git repository at:
git@github.com:jwpi/util-linux.git 171017
for you to fetch changes up to af54dbd929266f6706a34050ed51e5114f520f59:
hwclock: fix debug regression (2017-11-17 20:25:40 -0500)
----------------------------------------------------------------
J William Piggott (2):
hwclock: use reentrant time conversion functions
hwclock: fix debug regression
sys-utils/hwclock.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/2] Pull Request
2017-11-18 21:19 J William Piggott
@ 2017-11-20 11:08 ` Karel Zak
0 siblings, 0 replies; 10+ messages in thread
From: Karel Zak @ 2017-11-20 11:08 UTC (permalink / raw)
To: J William Piggott; +Cc: util-linux
On Sat, Nov 18, 2017 at 04:19:15PM -0500, J William Piggott wrote:
> J William Piggott (2):
> hwclock: use reentrant time conversion functions
> hwclock: fix debug regression
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 0/2] Pull Request
@ 2017-12-24 20:36 J William Piggott
0 siblings, 0 replies; 10+ messages in thread
From: J William Piggott @ 2017-12-24 20:36 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
The following changes since commit 43afa84581de8984aa00ef2e9208198929f72ddf:
lib/mbsalign: encode \x to \xecx (2017-12-20 13:01:43 +0100)
are available in the git repository at:
git@github.com:jwpi/util-linux.git 171213
for you to fetch changes up to e3fac9e420c55ae804199da6be2eb08ba9788795:
hwclock: add --ul-debug implementing debug.h (2017-12-24 14:19:26 -0500)
----------------------------------------------------------------
J William Piggott (2):
hwclock: rename --debug option to --verbose
hwclock: add --ul-debug implementing debug.h
Documentation/deprecated.txt | 12 +++++
sys-utils/hwclock-rtc.c | 10 ++---
sys-utils/hwclock.8.in | 15 ++++---
sys-utils/hwclock.c | 105 ++++++++++++++++++++++++-------------------
sys-utils/hwclock.h | 14 ++++--
5 files changed, 96 insertions(+), 60 deletions(-)
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-12-24 20:36 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-21 20:08 [PATCH 0/2] pull request J William Piggott
2017-09-21 20:09 ` [PATCH 1/2] hwclock: exit bug fix and single test mode message J William Piggott
2017-09-21 20:10 ` [PATCH 2/2] hwclock: make debug implicit for test mode J William Piggott
2017-09-22 10:04 ` [PATCH 0/2] pull request Karel Zak
-- strict thread matches above, loose matches on Subject: below --
2017-12-24 20:36 [PATCH 0/2] Pull Request J William Piggott
2017-11-18 21:19 J William Piggott
2017-11-20 11:08 ` Karel Zak
2017-07-18 19:59 J William Piggott
2017-06-22 0:49 [PATCH 0/2] pull request J William Piggott
2017-06-22 8:47 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox