Module Name:    src
Committed By:   kre
Date:           Wed May 10 10:34:30 UTC 2017

Modified Files:
        src/lib/libc/time: localtime.c

Log Message:
Turns out that the previous fix is incorrect, we were not doing ++hit
to change the boolean hit from false to true, but to change it from 1 to 2
which in a sense should have been obvious from the context:
        if (hit)
                /* more tests */
                        ++hit;
The real problem was that hit was (in the imported tzcode) incorrectly
changed from int to bool in a previous update.

Not that it matters, this code is never actually executed - it was there
to deal with the mythical double leapseconds, which simply never exist
(hit counted the number of leapseconds in an adjustment) and it will all
be gone in the next tzcode update.

For now, just turn hit back into an int, which should satisfy gcc 8,
I hope.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/lib/libc/time/localtime.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/localtime.c
diff -u src/lib/libc/time/localtime.c:1.107 src/lib/libc/time/localtime.c:1.108
--- src/lib/libc/time/localtime.c:1.107	Tue May  9 02:30:49 2017
+++ src/lib/libc/time/localtime.c	Wed May 10 10:34:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: localtime.c,v 1.107 2017/05/09 02:30:49 maya Exp $	*/
+/*	$NetBSD: localtime.c,v 1.108 2017/05/10 10:34:30 kre Exp $	*/
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char	elsieid[] = "@(#)localtime.c	8.17";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.107 2017/05/09 02:30:49 maya Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.108 2017/05/10 10:34:30 kre Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1698,7 +1698,7 @@ timesub(const time_t *timep, int_fast32_
 	int			y;
 	const int *		ip;
 	int_fast64_t		corr;
-	bool			hit;
+	int			hit;
 	int			i;
 
 	corr = 0;
@@ -1716,7 +1716,7 @@ timesub(const time_t *timep, int_fast32_
 						sp->lsis[i - 1].ls_trans + 1 &&
 						sp->lsis[i].ls_corr ==
 						sp->lsis[i - 1].ls_corr + 1) {
-							hit = true;
+							++hit;
 							--i;
 					}
 			}

Reply via email to