Subject: pkg/14581: timezone handling bug in cronolog package
To: None <>
From: Dave Huang <>
List: netbsd-bugs
Date: 11/13/2001 22:15:57
>Number:         14581
>Category:       pkg
>Synopsis:       timezone handling bug in cronolog package
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 13 20:17:01 PST 2001
>Originator:     Dave Huang
>Release:        NetBSD 1.5Y
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 26 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
System: NetBSD 1.5Y NetBSD 1.5Y (YERFABLE) #182: Sat Nov 3 03:42:35 CST 2001 alpha
Architecture: alpha
Machine: alpha
	cronolog uses localtime_r(), but never calls tzset() to
initialize the timezone info. As a result, one line goes into an
incorrectly-named logfile (it later calls localtime(), which
initializes the TZ info).
	Use cronolog with the timezone set to Central Time. If the
format string is log.%Y%U, for example, notice that a logfile named
log.200144 is created, even though date +"%Y%U" shows 200145.
Add this file as patch-ab

--- cronolog.c.orig	Tue Nov 13 22:02:01 2001
+++ cronolog.c	Tue Nov 13 22:02:16 2001
@@ -242,6 +242,7 @@
     DEBUG(("periodicity = %s\n", periods[periodicity]));
+    tzset();
     /* Loop, waiting for data on standard input */