Util-Linux Archive on lore.kernel.org
 help / color / Atom feed
From: pierre@irsamc.ups-tlse.fr
To: util-linux@vger.kernel.org
Subject: Subject: [PATCH] Fix adjtime documentation
Date: Wed, 04 Dec 2019 15:37:06 +0100
Message-ID: <8c9af50033cf8d287a8df373d4cade93@irsamc.ups-tlse.fr> (raw)

The first line of the adjtime file is made of three numbers (see 
hwclock.c)
- a drift factor as a decimal float
- the time of last adjust as a decimal integer
- a zero (for compatibility) as a decimal float.
but both man pages (hwclock.8 and adj_time.5) tell that the third number
is a decimal integer.
Of course this is harmless if somebody edits the adjtime file with "0" 
as
the third number: it will be correctly read by hwclock anyway.
But if for some reason, a program reads the adjtime file and expects an
integer, it will fail, because hwclock writes O.OOOO0O as the third 
number.

Signed-off-by: Pierre Labastie <pierre.labastie@neuf.fr>
---
  sys-utils/adjtime_config.5 | 2 +-
  sys-utils/hwclock.8.in     | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-utils/adjtime_config.5 b/sys-utils/adjtime_config.5
index 049d4c585..fcdc7bf6c 100644
--- a/sys-utils/adjtime_config.5
+++ b/sys-utils/adjtime_config.5
@@ -36,7 +36,7 @@ the systematic drift rate in seconds per day (floating 
point d
ecimal)
  the resulting number of seconds since  1969  UTC  of  most recent 
adjustment or calibration (decimal integer)
  .TP
  .B "adjustment status"
-zero (for compatibility with clock(8)) as a decimal integer.
+zero (for compatibility with clock(8)) as a floating point decimal.

  .SS Second line
  .TP
diff --git a/sys-utils/hwclock.8.in b/sys-utils/hwclock.8.in
index 6c3a2e6ac..e62b4ad09 100644
--- a/sys-utils/hwclock.8.in
+++ b/sys-utils/hwclock.8.in
@@ -652,7 +652,7 @@ in seconds per day, floating point decimal; 2) the 
resulting number of
  seconds since 1969 UTC of most recent adjustment or calibration,
  decimal integer; 3) zero (for compatibility with
  .BR \%clock (8))
-as a decimal integer.
+as a floating point decimal.
  .PP
  Line 2: One number: the resulting number of seconds since 1969 UTC of 
most
  recent calibration.  Zero if there has been no calibration yet or it
-- 
2.24.0

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 14:37 pierre [this message]
2019-12-06 11:52 ` Karel Zak

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c9af50033cf8d287a8df373d4cade93@irsamc.ups-tlse.fr \
    --to=pierre@irsamc.ups-tlse.fr \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Util-Linux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org
	public-inbox-index util-linux

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git