aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-07-27 14:31:59 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-27 14:31:59 +0200
commite9a5a6985ca7f484df60df1f9bdc8b62eac88f2e (patch)
tree115df45990a5cfc3236de23fd87c72caf91c6fad /util-linux
parent1d8df52d451c2085365dd2a457e498a7891348ee (diff)
downloadbusybox-e9a5a6985ca7f484df60df1f9bdc8b62eac88f2e.tar.gz
rdate: tweak comments, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/rdate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 66b877e24..14ce591e9 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -41,7 +41,7 @@ static time_t askremotedate(const char *host)
uint32_t nett;
int fd;
- /* Add a timeout for dead or inaccessible servers */
+ /* Timeout for dead or inaccessible servers */
alarm(10);
signal(SIGALRM, socket_timeout);
@@ -53,9 +53,8 @@ static time_t askremotedate(const char *host)
close(fd);
/* Convert from network byte order to local byte order.
- * RFC 868 time is the number of seconds
- * since 00:00 (midnight) 1 January 1900 GMT
- * the RFC 868 time 2,208,988,800 corresponds to 00:00 1 Jan 1970 GMT
+ * RFC 868 time is seconds since 1900-01-01 00:00 GMT.
+ * RFC 868 time 2,208,988,800 corresponds to 1970-01-01 00:00 GMT.
* Subtract the RFC 868 time to get Linux epoch.
*/
nett = ntohl(nett) - RFC_868_BIAS;
@@ -66,7 +65,7 @@ static time_t askremotedate(const char *host)
* current time cur = 0x123ffffffff.
* Assuming our time is not some 40 years off,
* remote time must be 0x12400000001.
- * Need to adjust out time by (int32_t)(nett - cur).
+ * Need to adjust our time by (int32_t)(nett - cur).
*/
time_t cur = time(NULL);
int32_t adjust = (int32_t)(nett - (uint32_t)cur);