Subject: pkg/11256: MIT-pthreads based packages
To: None <gnats-bugs@gnats.netbsd.org>
From: None <tom@minnesota.com>
List: netbsd-bugs
Date: 10/18/2000 12:48:13
>Number:         11256
>Category:       pkg
>Synopsis:       MIT-pthreads based packages returns wrong timezone value
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 18 12:48:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Thomas T. Thai
>Release:        20001017
>Organization:
Minnesota.com
>Environment:
System: NetBSD ns01 1.5_ALPHA2 NetBSD 1.5_ALPHA2 (ALPHA-$Revision: 1.127.2.2 $) #5: Tue Oct 3 17:37:31 CDT 2000 tom@ns01:/usr/src/sys/arch/alpha/compile/ns01-new alpha

>Description:
For packages that's based on or use MIT-pthreads, the problem is timezone value
is returned as a long instead of an int. This causes problems if you live in a
negative GMT timezone, which returns a very BIG number.

The packages that i'm aware of that this affects include mysql-server,
mit-pthreads, unproven-mit-pthreads.

Credit: David Huang 

>How-To-Repeat:
Build mysql-server and do "select now();"

>Fix:
*** gen/ctime.c.orig    Sat Mar 25 18:08:01 1995
--- gen/ctime.c Wed Oct 18 05:25:47 2000
***************
*** 129,135 ****
  ** Prototypes for static functions.
  */

! static long                   detzcode __P((const char *));
  static const char *   getnum __P((const char *, int *, int, int));
  static const char *   getsecs __P((const char *, long *));
  static const char *   getoffset __P((const char *, long *));
--- 129,135 ----
  ** Prototypes for static functions.
  */

! static int                    detzcode __P((const char *));
  static const char *   getnum __P((const char *, int *, int, int));
  static const char *   getsecs __P((const char *, long *));
  static const char *   getoffset __P((const char *, long *));
***************
*** 175,183 ****
  time_t                        altzone = 0;
  #endif /* defined ALTZONE */


! static int detzcode(const char * codep)
  {
!       int result;
        int     i;

        result = 0;
>Release-Note:
>Audit-Trail:
>Unformatted: