diff options
author | 2015-08-26 01:25:57 +0000 | |
---|---|---|
committer | 2015-08-26 01:25:57 +0000 | |
commit | d4bd758816383fd02a7984148929452470d4a81d (patch) | |
tree | e13bb8f1f23311ea00da555df2677bccb30378a2 | |
parent | Improve robots(6) by using timespec*() functions, replacing gettimeofday() (diff) | |
download | wireguard-openbsd-d4bd758816383fd02a7984148929452470d4a81d.tar.xz wireguard-openbsd-d4bd758816383fd02a7984148929452470d4a81d.zip |
Replace clock_gettime UPTIME with MONOTONIC to improve worm portability.
ok deraadt@, guenther@.
-rw-r--r-- | games/worm/worm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/games/worm/worm.c b/games/worm/worm.c index d8d01320dab..a6dc6ff78ef 100644 --- a/games/worm/worm.c +++ b/games/worm/worm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: worm.c,v 1.31 2015/08/24 21:52:12 rzalamena Exp $ */ +/* $OpenBSD: worm.c,v 1.32 2015/08/26 01:25:57 rzalamena Exp $ */ /* * Copyright (c) 1980, 1993 @@ -156,7 +156,7 @@ main(int argc, char **argv) process(lastch); } else { /* Check for timeout. */ - clock_gettime(CLOCK_UPTIME, &tn); + clock_gettime(CLOCK_MONOTONIC, &tn); if (timespeccmp(&t, &tn, <=)) { t = tn; t.tv_sec += 1; @@ -180,7 +180,7 @@ main(int argc, char **argv) continue; /* Update using clock_gettime(), tn is too old now. */ - clock_gettime(CLOCK_UPTIME, &t); + clock_gettime(CLOCK_MONOTONIC, &t); t.tv_sec += 1; } } |