From ea81c0624f0213430ae8fb959e30373eeaaf391c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 17 Jul 2013 10:39:11 -0400 Subject: fix error code on time conversion overflows POSIX mandates EOVERFLOW for this condition. --- src/time/timegm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/time/timegm.c') diff --git a/src/time/timegm.c b/src/time/timegm.c index 7148fca3..e7a7939b 100644 --- a/src/time/timegm.c +++ b/src/time/timegm.c @@ -7,7 +7,7 @@ time_t timegm(struct tm *tm) struct tm new; long long t = __tm_to_secs(tm); if (__secs_to_tm(t, &new) < 0) { - errno = EINVAL; + errno = EOVERFLOW; return -1; } *tm = new; -- cgit v1.2.1