From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 21 15:30:08 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D29A16A41B for ; Mon, 21 Jan 2008 15:30:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0D4E013C4EF for ; Mon, 21 Jan 2008 15:30:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m0LFU7Yk071483 for ; Mon, 21 Jan 2008 15:30:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m0LFU73f071480; Mon, 21 Jan 2008 15:30:07 GMT (envelope-from gnats) Resent-Date: Mon, 21 Jan 2008 15:30:07 GMT Resent-Message-Id: <200801211530.m0LFU73f071480@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Dmitrij N.Babin" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D385416A417 for ; Mon, 21 Jan 2008 15:28:13 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id C5C9A13C4D3 for ; Mon, 21 Jan 2008 15:28:13 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m0LFQiU0069708 for ; Mon, 21 Jan 2008 15:26:44 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m0LFQhnn069707; Mon, 21 Jan 2008 15:26:43 GMT (envelope-from nobody) Message-Id: <200801211526.m0LFQhnn069707@www.freebsd.org> Date: Mon, 21 Jan 2008 15:26:43 GMT From: "Dmitrij N.Babin" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/119862: Incorrect mktime() work X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2008 15:30:08 -0000 >Number: 119862 >Category: bin >Synopsis: Incorrect mktime() work >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 21 15:30:07 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Dmitrij N.Babin >Release: 6.2, 4.11 >Organization: online.ua >Environment: FreeBSD drummy 6.2-RELEASE-p7 FreeBSD 6.2-RELEASE-p7 #3: Fri Sep 28 18:27:53 EEST 2007 root@drummy:/usr/obj/usr/src/sys/DRUMMY amd64 FreeBSD hz.albur-online.com 4.11-RELEASE FreeBSD 4.11-RELEASE #0: Fri Jan 21 17:21:22 GMT 2005 root@perseus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: #include #include struct tm tf,tt,tt2; main() { time_t t_f, t_t, t_t2; int days, days2; /*---*/ tf.tm_sec=tt.tm_sec=tt2.tm_sec=0; tf.tm_min=tt.tm_min=tt2.tm_min=0; tf.tm_hour=tt.tm_hour=tt2.tm_hour=0; /*---*/ tf.tm_year=tt.tm_year=tt2.tm_year=2008-1900; /* Year - 2008 */ tf.tm_mon=2; /* February */ tt.tm_mon=2; tt2.tm_mon=3; /* March */ /*---*/ tf.tm_mday=1; tt.tm_mday=29; tt2.tm_mday=1; /*---*/ t_f=mktime(&tf); t_t=mktime(&tt); t_t2=mktime(&tt2); days=(t_t-t_f)/86400+1; days2=(t_t2-t_f)/86400+1; printf("\nFrom 1-02 to 29-02 full days:%u\nFrom 1-02 to 1-03 full days:%u\n",days,days2); } drum@drummy> cc ttt3.c drum@drummy> ./a.out >From 1-02 to 29-02 full days:29 >From 1-02 to 1-03 full days:32 >How-To-Repeat: just compile and run >Fix: dont know >Release-Note: >Audit-Trail: >Unformatted: