Improved year 2038 safety
authorEric Biggers <ebiggers3@gmail.com>
Wed, 19 Apr 2017 06:58:03 +0000 (23:58 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 19 Apr 2017 07:17:01 +0000 (00:17 -0700)
commitdb1b9ac63e5c0a1dffb51a1a162cf69a01a5cf24
tree7dea2f518e403f06f0d091f2295c591cabeae937
parent088dff37aa334c218e1cac96cc847f5dd14f7124
Improved year 2038 safety

Make wimlib on 32-bit Windows year 2038 safe by doing the following:

- Build both the library and program with 64-bit time_t, being careful
  to avoid changing the timespec struct exposed in the API.
- Update wimlib's API to include an extended seconds field in
  wimlib_dir_entry for each timestamp, and set it when tv_sec is 32-bit.
- When needing the current time, call GetSystemTimeAsFileTime() instead
  of MinGW's gettimeofday().

This also has the advantage that due to switching to the 64-bit time_t
functions, 32-bit wimlib-imagex.exe now prints timestamps prior to year
1970 correctly.

Unfortunately, despite the API improvement, we cannot at this time make
wimlib fully Y2038-safe on 32-bit UNIX, due to lack of OS support.
configure.ac
include/wimlib.h
include/wimlib/timestamp.h
programs/imagex.c
src/iterate_dir.c
src/timestamp.c
src/win32_replacements.c