mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-26 20:40:28 +00:00
Choose better deterministic timestamp for zip
This commit is contained in:
parent
b45d50b690
commit
bf62140377
7 changed files with 32 additions and 30 deletions
|
@ -145,6 +145,8 @@ void elfwriter_zip(struct ElfWriter *elf, const char *symbol, const char *name,
|
|||
size_t lfilehdrsize, uncompsize, compsize, commentsize;
|
||||
uint16_t method, gflags, mtime, mdate, iattrs, dosmode;
|
||||
|
||||
CHECK_NE(0, mtim.tv_sec);
|
||||
|
||||
gflags = 0;
|
||||
iattrs = 0;
|
||||
compsize = size;
|
||||
|
|
|
@ -26,11 +26,13 @@
|
|||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/sysv/consts/clock.h"
|
||||
#include "libc/sysv/consts/ex.h"
|
||||
#include "libc/sysv/consts/exit.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/x/x.h"
|
||||
#include "third_party/getopt/getopt.h"
|
||||
#include "tool/build/lib/elfwriter.h"
|
||||
|
@ -166,6 +168,8 @@ void zipobj(int argc, char **argv) {
|
|||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
timestamp.tv_sec = 1647414000; /* determinism */
|
||||
/* clock_gettime(CLOCK_REALTIME, ×tamp); */
|
||||
zipobj(argc, argv);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue