From owner-freebsd-bugs Mon Sep 20 10:30:12 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 8817015390 for ; Mon, 20 Sep 1999 10:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id KAA30780; Mon, 20 Sep 1999 10:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id E4E7415390; Mon, 20 Sep 1999 10:23:10 -0700 (PDT) Message-Id: <19990920172310.E4E7415390@hub.freebsd.org> Date: Mon, 20 Sep 1999 10:23:10 -0700 (PDT) From: duwde@elitenet.com.br To: freebsd-gnats-submit@freebsd.org X-Send-Pr-Version: www-1.0 Subject: misc/13862: mktime() fails (returns -1) on some dates. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 13862 >Category: misc >Synopsis: mktime() fails (returns -1) on some dates. >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 20 10:30:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Fabio Dias >Release: 2.2.8-RELEASE (kernel 2.2.8-STABLE) >Organization: EliteNet ISP >Environment: FreeBSD cosmic.elitenet.com.br 2.2.8-STABLE FreeBSD 2.2.8-STABLE #0: Thu Sep 16 13:57:41 EST 1999 root@cosmic.elitenet.com.br:/usr/src/sys/compile/COSMIC i386 >Description: When using some specific dates, mktimes() is unable to return the real time_t and returns -1. >How-To-Repeat: /* Try this, there seems to be a problem in mktime(), using 2.2.8-RELEASE. mktime() doesn't work when using dates like (day/month/year): 03/10/1999 - 16/10/1994 - and others... Duwde */ #include #include #include int main(int argc, char **argv) { time_t timet_x; struct tm tm_x, *tm_px=&tm_x; memset(tm_px,(int)NULL,sizeof(tm_x)); tm_px->tm_mday=3; /* 03 */ tm_px->tm_mon=9; /* 10 */ tm_px->tm_year=99; /* 1999 */ if ((timet_x=mktime(tm_px)) == -1) { printf("mktime() returned -1\n"); printf("asctime(tm_px) -> %s\n",asctime(tm_px)); printf("ctime(&timet_x) -> %s\n",ctime(&timet_x)); } else printf("everything is ok...\n"); return (int)0; >Fix: Fix the mktime() >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message