Commit 3b3887a
committed
src: extended checking of mktime() return value and capability
mktime() can legitimately return -1 under glibc and FreeBSD (and
possibly others), namely for 1970-01-01T00:59:59+0100. This means the
return value alone is not good enough to determine failure status.
The Linux mktime(3) manpage gives a way out:
[on error] leaves the tm->tm_wday member unmodified.
Since tm_wday gets normalized to [0..6], using any other value as
input allows to determine failure status.1 parent 5fa7f44 commit 3b3887a
File tree
4 files changed
+16
-4
lines changed- exch
- midb
- nsp
- lib/mapi
- tools
4 files changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
| 1113 | + | |
1113 | 1114 | | |
| 1115 | + | |
| 1116 | + | |
1114 | 1117 | | |
1115 | 1118 | | |
1116 | 1119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
753 | | - | |
| 753 | + | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
757 | 759 | | |
| 760 | + | |
758 | 761 | | |
759 | 762 | | |
760 | 763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| 501 | + | |
501 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
502 | 507 | | |
503 | 508 | | |
504 | 509 | | |
| |||
0 commit comments