All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Pull Request
@ 2017-04-27  3:29 J William Piggott
  2017-04-27  3:33 ` [PATCH 1/4] hwclock: extra messages for debug only J William Piggott
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: J William Piggott @ 2017-04-27  3:29 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, junk


 sys-utils/hwclock.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

The following changes since commit 85bfb519afcbccccb63849b1a348dde76ff6bb83:

  switch_root: unlink files without _DIRENT_HAVE_D_TYPE (2017-04-26 11:23:50 +0200)

are available in the git repository at:

  git@github.com:jwpi/util-linux.git 170419

for you to fetch changes up to 57415653a667cf2442d019f62287534931ab3da4:

  hwclock: use a consistent name for --predict (2017-04-26 23:19:56 -0400)

----------------------------------------------------------------
J William Piggott (4):
      hwclock: extra messages for debug only
      hwclock: make clock test mode message consistent
      hwclock: remove unneeded braces
      hwclock: use a consistent name for --predict

 sys-utils/hwclock.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] hwclock: extra messages for debug only
  2017-04-27  3:29 [PATCH 0/4] Pull Request J William Piggott
@ 2017-04-27  3:33 ` J William Piggott
  2017-04-27  3:36 ` [PATCH 2/4] hwclock: make clock test mode message consistent J William Piggott
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: J William Piggott @ 2017-04-27  3:33 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, junk


Only print extra save_adjtime() messages in debug mode. This makes
the --test mode output consistent accross functions.

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

diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index a98f4e3..31ee8fe 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -919,10 +919,10 @@ static void save_adjtime(const struct hwclock_control *ctl,
 		  (adjtime->local_utc == LOCAL) ? "LOCAL" : "UTC");
 
 	if (ctl->testing) {
-		printf(_
-		       ("Not updating adjtime file because of testing mode.\n"));
-		printf(_("Would have written the following to %s:\n%s"),
-		       ctl->adj_file_name, content);
+		if (ctl->debug){
+			printf(_("Test mode: %s was not updated with:\n%s"),
+			       ctl->adj_file_name, content);
+		}
 		free(content);
 		return;
 	}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] hwclock: make clock test mode message consistent
  2017-04-27  3:29 [PATCH 0/4] Pull Request J William Piggott
  2017-04-27  3:33 ` [PATCH 1/4] hwclock: extra messages for debug only J William Piggott
@ 2017-04-27  3:36 ` J William Piggott
  2017-04-27  3:39 ` [PATCH 3/4] hwclock: remove unneeded braces J William Piggott
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: J William Piggott @ 2017-04-27  3:36 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux


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 31ee8fe..4a187c5 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -391,7 +391,7 @@ set_hardware_clock(const struct hwclock_control *ctl, const time_t newtime)
 		       new_broken_time.tm_sec, (long)newtime);
 
 	if (ctl->testing)
-		printf(_("Clock not changed - testing only.\n"));
+		printf(_("Test mode: clock was not changed\n"));
 	else {
 		ur->set_hardware_clock(ctl, &new_broken_time);
 	}
@@ -636,7 +636,7 @@ set_system_clock(const struct hwclock_control *ctl, const bool hclock_valid,
 		}
 		if (ctl->testing) {
 			printf(_
-			       ("Not setting system clock because running in test mode.\n"));
+			       ("Test mode: clock was not changed\n"));
 			retcode = 0;
 		} else {
 			const struct timezone tz = { minuteswest, 0 };
@@ -724,7 +724,7 @@ static int set_system_clock_timezone(const struct hwclock_control *ctl)
 	}
 	if (ctl->testing) {
 		printf(_
-		       ("Not setting system clock because running in test mode.\n"));
+		       ("Test mode: clock was not changed\n"));
 		retcode = 0;
 	} else {
 		const struct timezone tz_utc = { 0, 0 };

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] hwclock: remove unneeded braces
  2017-04-27  3:29 [PATCH 0/4] Pull Request J William Piggott
  2017-04-27  3:33 ` [PATCH 1/4] hwclock: extra messages for debug only J William Piggott
  2017-04-27  3:36 ` [PATCH 2/4] hwclock: make clock test mode message consistent J William Piggott
@ 2017-04-27  3:39 ` J William Piggott
  2017-04-27  3:42 ` [PATCH 4/4] hwclock: use a consistent name for --predict J William Piggott
  2017-05-02  9:13 ` [PATCH 0/4] Pull Request Karel Zak
  4 siblings, 0 replies; 6+ messages in thread
From: J William Piggott @ 2017-04-27  3:39 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux


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

diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 4a187c5..e66acd2 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -392,9 +392,8 @@ set_hardware_clock(const struct hwclock_control *ctl, const time_t newtime)
 
 	if (ctl->testing)
 		printf(_("Test mode: clock was not changed\n"));
-	else {
+	else
 		ur->set_hardware_clock(ctl, &new_broken_time);
-	}
 }
 
 /*

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] hwclock: use a consistent name for --predict
  2017-04-27  3:29 [PATCH 0/4] Pull Request J William Piggott
                   ` (2 preceding siblings ...)
  2017-04-27  3:39 ` [PATCH 3/4] hwclock: remove unneeded braces J William Piggott
@ 2017-04-27  3:42 ` J William Piggott
  2017-05-02  9:13 ` [PATCH 0/4] Pull Request Karel Zak
  4 siblings, 0 replies; 6+ messages in thread
From: J William Piggott @ 2017-04-27  3:42 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux


The predict function name is documented as '--predict', but the
code uses '--predict-hc'. This works okay, except that the
'mutually exclusive' error message prints the undocumented name.

* sys-utils/hwclock.c: rename 'predict-hc' to 'predict' so that
    it matches the man-page. This should not be a problem because
    'predict-hc' was never documented.

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

diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index e66acd2..e890cb8 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1304,7 +1304,7 @@ int main(int argc, char **argv)
 		OPT_GETEPOCH,
 		OPT_LOCALTIME,
 		OPT_NOADJFILE,
-		OPT_PREDICT_HC,
+		OPT_PREDICT,
 		OPT_SET,
 		OPT_SETEPOCH,
 		OPT_SYSTZ,
@@ -1337,7 +1337,7 @@ int main(int argc, char **argv)
 #endif
 		{ "adjfile",      required_argument, NULL, OPT_ADJFILE    },
 		{ "systz",        no_argument,       NULL, OPT_SYSTZ      },
-		{ "predict-hc",   no_argument,       NULL, OPT_PREDICT_HC },
+		{ "predict",      no_argument,       NULL, OPT_PREDICT    },
 		{ "get",          no_argument,       NULL, OPT_GET        },
 		{ "update-drift", no_argument,       NULL, OPT_UPDATE     },
 		{ NULL, 0, NULL, 0 }
@@ -1345,7 +1345,7 @@ int main(int argc, char **argv)
 
 	static const ul_excl_t excl[] = {	/* rows and cols in ASCII order */
 		{ 'a','r','s','w',
-		  OPT_GET, OPT_GETEPOCH, OPT_PREDICT_HC,
+		  OPT_GET, OPT_GETEPOCH, OPT_PREDICT,
 		  OPT_SET, OPT_SETEPOCH, OPT_SYSTZ },
 		{ 'u', OPT_LOCALTIME},
 		{ OPT_ADJFILE, OPT_NOADJFILE },
@@ -1454,8 +1454,8 @@ int main(int argc, char **argv)
 			ctl.systz = 1;		/* --systz */
 			ctl.show = 0;
 			break;
-		case OPT_PREDICT_HC:
-			ctl.predict = 1;	/* --predict-hc */
+		case OPT_PREDICT:
+			ctl.predict = 1;	/* --predict */
 			ctl.show = 0;
 			break;
 		case OPT_GET:

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] Pull Request
  2017-04-27  3:29 [PATCH 0/4] Pull Request J William Piggott
                   ` (3 preceding siblings ...)
  2017-04-27  3:42 ` [PATCH 4/4] hwclock: use a consistent name for --predict J William Piggott
@ 2017-05-02  9:13 ` Karel Zak
  4 siblings, 0 replies; 6+ messages in thread
From: Karel Zak @ 2017-05-02  9:13 UTC (permalink / raw)
  To: J William Piggott; +Cc: util-linux, junk

On Wed, Apr 26, 2017 at 11:29:40PM -0400, J William Piggott wrote:
>       hwclock: extra messages for debug only
>       hwclock: make clock test mode message consistent
>       hwclock: remove unneeded braces
>       hwclock: use a consistent name for --predict

Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-02  9:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27  3:29 [PATCH 0/4] Pull Request J William Piggott
2017-04-27  3:33 ` [PATCH 1/4] hwclock: extra messages for debug only J William Piggott
2017-04-27  3:36 ` [PATCH 2/4] hwclock: make clock test mode message consistent J William Piggott
2017-04-27  3:39 ` [PATCH 3/4] hwclock: remove unneeded braces J William Piggott
2017-04-27  3:42 ` [PATCH 4/4] hwclock: use a consistent name for --predict J William Piggott
2017-05-02  9:13 ` [PATCH 0/4] Pull Request Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.