diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-08-08 21:02:37 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-08-08 21:02:37 +0000 |
commit | 95a98b5efa7b4ca7bffb156f1af26235611a3923 (patch) | |
tree | 99539712ef92faeae5ef2c294ff01bd62b9f02ef /gdb/ser-unix.c | |
parent | 3da5198c07ed520e12b734e1ca76d521139c28f2 (diff) | |
download | gdb-95a98b5efa7b4ca7bffb156f1af26235611a3923.zip gdb-95a98b5efa7b4ca7bffb156f1af26235611a3923.tar.gz gdb-95a98b5efa7b4ca7bffb156f1af26235611a3923.tar.bz2 |
* ser-unix.c (hardwire_send_break) [HAVE_SGTTY]: Use select not usleep.
Diffstat (limited to 'gdb/ser-unix.c')
-rw-r--r-- | gdb/ser-unix.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index 9b67230..353657a 100644 --- a/gdb/ser-unix.c +++ b/gdb/ser-unix.c @@ -359,10 +359,20 @@ hardwire_send_break (scb) #endif #ifdef HAVE_SGTTY - status = ioctl (scb->fd, TIOCSBRK, 0); - usleep (250000); - status = ioctl (scb->fd, TIOCCBRK, 0); - return status; + { + struct timeval timeout; + + status = ioctl (scb->fd, TIOCSBRK, 0); + + /* Can't use usleep; it doesn't exist in BSD 4.2. */ + /* Note that if this select() is interrupted by a signal it will not wait + the full length of time. I think that is OK. */ + timeout.tv_sec = 0; + timeout.tv_usec = 250000; + select (0, 0, 0, 0, &timeout); + status = ioctl (scb->fd, TIOCCBRK, 0); + return status; + } #endif } |