diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-02-24 12:35:01 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-02-24 12:35:01 +0000 |
commit | 6b03fdfcfaa7cd5a48c2e4a0b00d0497ac91b52f (patch) | |
tree | 52bba93b152de8dda6e82066260b58747f4f6b40 /Build/source/texk/dvipdfm-x/pdfencrypt.c | |
parent | 5a5800df04f8ac0c19b3c2f4c96eb9e46d6f992e (diff) |
texk/dvipdfm-x: Support to output a unique pdf from a unique xdv/dvi file.
git-svn-id: svn://tug.org/texlive/trunk@39846 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/pdfencrypt.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfencrypt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/pdfencrypt.c b/Build/source/texk/dvipdfm-x/pdfencrypt.c index 309cc7e2664..b039be1f50c 100644 --- a/Build/source/texk/dvipdfm-x/pdfencrypt.c +++ b/Build/source/texk/dvipdfm-x/pdfencrypt.c @@ -97,9 +97,13 @@ void pdf_enc_set_verbose (void) static void pdf_enc_init (int use_aes, int encrypt_metadata) { + time_t current_time; struct pdf_sec *p = &sec_data; - srand((unsigned) time(NULL)); /* For AES IV */ + current_time = get_unique_time_if_given(); + if (current_time == 0) + current_time = time(NULL); + srand(current_time); /* For AES IV */ p->setting.use_aes = use_aes; p->setting.encrypt_metadata = encrypt_metadata; } @@ -122,7 +126,9 @@ pdf_enc_compute_id_string (char *dviname, char *pdfname) MD5_init(&md5); date_string = NEW(15, char); - time(¤t_time); + current_time = get_unique_time_if_given(); + if (current_time == 0) + time(¤t_time); bd_time = localtime(¤t_time); sprintf(date_string, "%04d%02d%02d%02d%02d%02d", bd_time->tm_year + 1900, bd_time->tm_mon + 1, bd_time->tm_mday, |