diff options
author | NIIBE Yutaka <[email protected]> | 2017-11-07 01:49:36 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-11-20 10:53:44 +0000 |
commit | 760aa8aadafb747f33a1461ab0c2570b5ae43716 (patch) | |
tree | d741f7e8f1d9fecf960063d842731c5a21b3fa1b /agent/t-protect.c | |
parent | build: Check -Wlogical-op flag availability with -Werror. (diff) | |
download | gnupg-760aa8aadafb747f33a1461ab0c2570b5ae43716.tar.gz gnupg-760aa8aadafb747f33a1461ab0c2570b5ae43716.zip |
agent: Use clock or clock_gettime for calibration.
* agent/protect.c (calibrate_get_time): Use clock or clock_gettime.
--
For calibration, clock(3) is better than times(3) among UNIXen.
Tested on NetBSD 7.1 and FreeBSD 11.1, using QEMU.
Thanks to Damien Goutte-Gattat for the information of use of
CLOCKS_PER_SEC; The old code with times(3) is not 100% correct,
in terms of POSIX. It should have used sysconf (_SC_CLK_TCK) instead
of CLOCKS_PER_SEC. CLOCKS_PER_SEC is specifically for clock(3).
GnuPG-bug-id: 3056, 3276, 3472
Signed-off-by: NIIBE Yutaka <[email protected]>
(cherry picked from commit 380bce13d94ff03c96e39ac1d834f382c5c730a1)
Diffstat (limited to 'agent/t-protect.c')
-rw-r--r-- | agent/t-protect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/agent/t-protect.c b/agent/t-protect.c index 1d3c8ec17..92d312c9b 100644 --- a/agent/t-protect.c +++ b/agent/t-protect.c @@ -322,9 +322,9 @@ test_agent_protect_shared_secret (void) int main (int argc, char **argv) { - (void)argc; (void)argv; + opt.verbose = argc - 1; /* We can do "./t-protect -v -v" */ gcry_control (GCRYCTL_DISABLE_SECMEM); test_agent_protect (); |