Lamar Owen <[EMAIL PROTECTED]> writes:

> Where would we go to ferret out the source of this bug?  More to the
> point: we need a test case in C that could expose this as a glibc
> bug.  

Seems like mktime(3) is having problems with dates before the
epoch. Attached is the a program to test this. The glibc source is now
downloading I will try to hunt down this bug but not until the next
week.

Regards,
Manuel.
#include <stdio.h>
#include <time.h>

int main(int argc, char *argv[])
{
    struct tm fails;

    fails.tm_sec = 0;
    fails.tm_min = 0;
    fails.tm_hour = 0;
    fails.tm_hour = 0;
    fails.tm_isdst = -1;

    fails.tm_year = 69;
    fails.tm_mon = 11;
    fails.tm_mday = 30;

    if ( mktime(&fails) != -151200L ) {
        printf("mktime is broken\n");
        return 1;
    }

    printf("mktime test passed\n");    
    return 0;
}

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to