The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix mktime error condition

- https://pubs.opengroup.org/onlinepubs/9799919799/functions/mktime.html
- https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64?view=msvc-170
- C11 standard § 7.26.2.3 The mktime function

+4 -4
+4 -4
otherlibs/unix/gmtime.c
··· 81 81 tm.tm_mday = Int_val(Field(t, 3)); 82 82 tm.tm_mon = Int_val(Field(t, 4)); 83 83 tm.tm_year = Int_val(Field(t, 5)); 84 - tm.tm_wday = Int_val(Field(t, 6)); 85 - tm.tm_yday = Int_val(Field(t, 7)); 86 - tm.tm_isdst = -1; /* tm.tm_isdst = Bool_val(Field(t, 8)); */ 84 + tm.tm_isdst = -1; 85 + tm.tm_wday = -1; 87 86 clock = mktime(&tm); 88 - if (clock == (time_t) -1) caml_unix_error(ERANGE, "mktime", Nothing); 87 + if (clock == (time_t) -1 && tm.tm_wday == -1) 88 + caml_uerror("mktime", Nothing); 89 89 tmval = alloc_tm(&tm); 90 90 clkval = caml_copy_double((double) clock); 91 91 res = caml_alloc_small(2, 0);