aboutsummaryrefslogtreecommitdiff
path: root/timezone/zdump.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-11-11 02:05:42 +0000
committerUlrich Drepper <drepper@redhat.com>2006-11-11 02:05:42 +0000
commit064737fb74ac2a47916b9be162a6a098cde99816 (patch)
treeb1b2838f61216fc8378445bfc8fa291d32ae7b0f /timezone/zdump.c
parent6decd24cc22116dea9da17c548d0ea0e9b6d5bfc (diff)
downloadglibc-064737fb74ac2a47916b9be162a6a098cde99816.tar
glibc-064737fb74ac2a47916b9be162a6a098cde99816.tar.gz
glibc-064737fb74ac2a47916b9be162a6a098cde99816.tar.bz2
glibc-064737fb74ac2a47916b9be162a6a098cde99816.zip
* time/tzfile.c (__tzfile_read): Extend to handle new file format
on machines with 64-bit time_t. * timezone/checktab.awk: Update from tzcode2006o. * timezone/ialloc.c: Likewise. * timezone/private.h: Likewise. * timezone/scheck.: Likewise. * timezone/tzfile.h: Likewise. * timezone/tzselect.ksh: Likewise. * timezone/zdump.c: Likewise. * timezone/zic.c: Likewise.
Diffstat (limited to 'timezone/zdump.c')
-rw-r--r--timezone/zdump.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/timezone/zdump.c b/timezone/zdump.c
index d525da1bae..b5dd09b861 100644
--- a/timezone/zdump.c
+++ b/timezone/zdump.c
@@ -1,4 +1,4 @@
-static char elsieid[] = "@(#)zdump.c 7.74";
+static char elsieid[] = "@(#)zdump.c 8.2";
/*
** This code has been made independent of the rest of the time
@@ -15,7 +15,7 @@ static char elsieid[] = "@(#)zdump.c 7.74";
#include "ctype.h" /* for isalpha et al. */
#ifndef isascii
#define isascii(x) 1
-#endif
+#endif /* !defined isascii */
#ifndef ZDUMP_LO_YEAR
#define ZDUMP_LO_YEAR (-500)
@@ -130,11 +130,7 @@ static char elsieid[] = "@(#)zdump.c 7.74";
#endif /* !defined TZ_DOMAIN */
#ifndef P
-#ifdef __STDC__
#define P(x) x
-#else /* !defined __STDC__ */
-#define P(x) ()
-#endif /* !defined __STDC__ */
#endif /* !defined P */
extern char ** environ;
@@ -389,7 +385,7 @@ _("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
}
if (fflush(stdout) || ferror(stdout)) {
(void) fprintf(stderr, "%s: ", progname);
- (void) perror(_("Error writing to standard output"));
+ (void) perror(_("Error writing standard output"));
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
@@ -418,14 +414,21 @@ _("%s: use of -v on system with floating time_t other than float or double\n"),
}
} else if (0 > (time_t) -1) {
/*
- ** time_t is signed.
+ ** time_t is signed. Assume overflow wraps around.
*/
- register time_t hibit;
+ time_t t = 0;
+ time_t t1 = 1;
- for (hibit = 1; (hibit * 2) != 0; hibit *= 2)
- continue;
- absolute_min_time = hibit;
- absolute_max_time = -(hibit + 1);
+ while (t < t1) {
+ t = t1;
+ t1 = 2 * t1 + 1;
+ }
+
+ absolute_max_time = t;
+ t = -t;
+ absolute_min_time = t - 1;
+ if (t < absolute_min_time)
+ absolute_min_time = t;
} else {
/*
** time_t is unsigned.
@@ -468,10 +471,7 @@ const long y;
}
static time_t
-hunt(name, lot, hit)
-char * name;
-time_t lot;
-time_t hit;
+hunt(char *name, time_t lot, time_t hit)
{
time_t t;
long diff;
@@ -541,10 +541,7 @@ struct tm * oldp;
}
static void
-show(zone, t, v)
-char * zone;
-time_t t;
-int v;
+show(char *zone, time_t t, int v)
{
register struct tm * tmp;