| OLD | NEW |
| 1 #define _GNU_SOURCE | 1 #define _GNU_SOURCE |
| 2 #include "time_impl.h" | 2 #include "time_impl.h" |
| 3 #include <errno.h> | 3 #include <errno.h> |
| 4 | 4 |
| 5 extern const char __gmt[]; | 5 extern const char __gmt[]; |
| 6 | 6 |
| 7 time_t timegm(struct tm *tm) | 7 time_t timegm(struct tm* tm) { |
| 8 { | 8 struct tm new; |
| 9 » struct tm new; | 9 long long t = __tm_to_secs(tm); |
| 10 » long long t = __tm_to_secs(tm); | 10 if (__secs_to_tm(t, &new) < 0) { |
| 11 » if (__secs_to_tm(t, &new) < 0) { | 11 errno = EOVERFLOW; |
| 12 » » errno = EOVERFLOW; | 12 return -1; |
| 13 » » return -1; | 13 } |
| 14 » } | 14 *tm = new; |
| 15 » *tm = new; | 15 tm->tm_isdst = 0; |
| 16 » tm->tm_isdst = 0; | 16 tm->__tm_gmtoff = 0; |
| 17 » tm->__tm_gmtoff = 0; | 17 tm->__tm_zone = __gmt; |
| 18 » tm->__tm_zone = __gmt; | 18 return t; |
| 19 » return t; | |
| 20 } | 19 } |
| OLD | NEW |