diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2001-02-22 08:59:19 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2001-02-22 08:59:19 +0000 |
commit | d3217841917f5fc8ef4056d83eab03f94349cc5d (patch) | |
tree | c812a74e1b8b67c0af241e72245edf67c80b062a /otherlibs | |
parent | 770b5de3e773124f8cbdd606659d6e5481b365cc (diff) |
Detecter les dates impossibles dans mktime (PR#288)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3435 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs')
-rw-r--r-- | otherlibs/unix/gmtime.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/otherlibs/unix/gmtime.c b/otherlibs/unix/gmtime.c index 475736be9..2a75bce2c 100644 --- a/otherlibs/unix/gmtime.c +++ b/otherlibs/unix/gmtime.c @@ -75,6 +75,7 @@ value unix_mktime(value t) /* ML */ tm.tm_yday = Int_val(Field(t, 7)); tm.tm_isdst = -1; /* tm.tm_isdst = Bool_val(Field(t, 8)); */ clock = mktime(&tm); + if (clock == (time_t) -1) unix_error(ERANGE, "mktime", Nothing); tmval = alloc_tm(&tm); clkval = copy_double((double) clock); res = alloc_small(2, 0); |