diff options
author | 2014-10-28 05:48:22 +0000 | |
---|---|---|
committer | 2014-10-28 05:48:22 +0000 | |
commit | 8bb8b19e21ce734e0b4e924ffdd428c19ebac580 (patch) | |
tree | 62b1e3dd63bb870fc73941423cb99a604cdc572a | |
parent | Check the result of sk_*_push() operations for failure. (diff) | |
download | wireguard-openbsd-8bb8b19e21ce734e0b4e924ffdd428c19ebac580.tar.xz wireguard-openbsd-8bb8b19e21ce734e0b4e924ffdd428c19ebac580.zip |
use nanosleep() instead of hackish select(); ok dlg
-rw-r--r-- | usr.sbin/iostat/iostat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index fefb7edf4b0..c6029095fd5 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iostat.c,v 1.36 2014/10/26 20:37:15 brad Exp $ */ +/* $OpenBSD: iostat.c,v 1.37 2014/10/28 05:48:22 deraadt Exp $ */ /* $NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $ */ /* @@ -115,7 +115,7 @@ main(int argc, char *argv[]) { const char *errstr; int ch, hdrcnt; - struct timeval tv; + struct timespec ts; while ((ch = getopt(argc, argv, "Cc:dDIM:N:Tw:")) != -1) switch(ch) { @@ -164,8 +164,8 @@ main(int argc, char *argv[]) dkreadstats(); selectdrives(argv); - tv.tv_sec = interval; - tv.tv_usec = 0; + ts.tv_sec = interval; + ts.tv_nsec = 0; /* print a new header on sigcont */ signal(SIGCONT, sigheader); @@ -183,7 +183,7 @@ main(int argc, char *argv[]) if (reps >= 0 && --reps <= 0) break; - select(0, NULL, NULL, NULL, &tv); + nanosleep(&ts, NULL); dkreadstats(); if (last.dk_ndrive != cur.dk_ndrive) wantheader = 1; |