diff options
author | 2014-10-09 06:20:01 +0000 | |
---|---|---|
committer | 2014-10-09 06:20:01 +0000 | |
commit | 134d7d8bf0daadee3a4a244c588180eef43f027b (patch) | |
tree | 46dec34e27fcd514d65fee5007f21a2a57837a16 | |
parent | sync (diff) | |
download | wireguard-openbsd-134d7d8bf0daadee3a4a244c588180eef43f027b.tar.xz wireguard-openbsd-134d7d8bf0daadee3a4a244c588180eef43f027b.zip |
replace the use of select() for a short sleep with nanosleep().
ok deraadt@ guenther@
-rw-r--r-- | lib/libc/termios/tcsendbreak.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/termios/tcsendbreak.c b/lib/libc/termios/tcsendbreak.c index 79e80f5958b..796684a7881 100644 --- a/lib/libc/termios/tcsendbreak.c +++ b/lib/libc/termios/tcsendbreak.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcsendbreak.c,v 1.6 2005/08/05 13:03:00 espie Exp $ */ +/* $OpenBSD: tcsendbreak.c,v 1.7 2014/10/09 06:20:01 dlg Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -43,13 +43,14 @@ int tcsendbreak(int fd, int len) { - struct timeval sleepytime; + struct timespec sleepytime; sleepytime.tv_sec = 0; - sleepytime.tv_usec = 400000; + sleepytime.tv_nsec = 400000000; + if (ioctl(fd, TIOCSBRK, 0) == -1) return (-1); - (void)select(0, 0, 0, 0, &sleepytime); + (void)nanosleep(&sleepytime, NULL); if (ioctl(fd, TIOCCBRK, 0) == -1) return (-1); return (0); |