X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftime%2Ftimegm.c;h=b5dae8b648eca781ca9e726f90d5b6cc85b72d1a;hb=d3357268791f5279b64665a9a5b5629c962c8a15;hp=7148fca32b1c35f8e57ec062465d5be9a878d3d1;hpb=1cc81f5cb0df2b66a795ff0c26d7bbc4d16e13c6;p=musl diff --git a/src/time/timegm.c b/src/time/timegm.c index 7148fca3..b5dae8b6 100644 --- a/src/time/timegm.c +++ b/src/time/timegm.c @@ -2,17 +2,19 @@ #include "time_impl.h" #include +extern const char __gmt[]; + 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; tm->tm_isdst = 0; tm->__tm_gmtoff = 0; - tm->__tm_zone = "GMT"; + tm->__tm_zone = __gmt; return t; }