summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@cvs.openbsd.org>2015-08-26 01:25:58 +0000
committerRafael Zalamena <rzalamena@cvs.openbsd.org>2015-08-26 01:25:58 +0000
commitac2a6151bdd6d28dc4f8c26284cc08a9d15466dd (patch)
treeeee1e121bcaa9d2957c089bb6f6e85de81f71a54
parentea7b4737a2274a814a2c9b78bfabad346fda0989 (diff)
Replace clock_gettime UPTIME with MONOTONIC to improve worm portability.
ok deraadt@, guenther@.
-rw-r--r--games/worm/worm.c6
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;
}
}