aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1996-10-12 10:41:56 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1996-10-12 10:41:56 +0000
commitd1a3967b594542d857a5431d41abc0930e539a17 (patch)
treeee11e8a30f7509fb6e4af23c6482ff09d9b6435e /gnu
parentc79a9ab9e58aa8788b2bed0849130b908ae3244f (diff)
downloadsrc-d1a3967b594542d857a5431d41abc0930e539a17.tar.gz
src-d1a3967b594542d857a5431d41abc0930e539a17.zip
Catch a situation where the tty speed might be 0 (in the case of UUCP
over TCP), but is used as a divisor later, causing uucico to abort with a SIGFPE. Reviewed by: Ian Lance Taylor <ian@cygnus.com>
Notes
Notes: svn path=/head/; revision=18880
Diffstat (limited to 'gnu')
-rw-r--r--gnu/libexec/uucp/libunix/serial.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gnu/libexec/uucp/libunix/serial.c b/gnu/libexec/uucp/libunix/serial.c
index a38e28c729b0..29bef9f4a4c7 100644
--- a/gnu/libexec/uucp/libunix/serial.c
+++ b/gnu/libexec/uucp/libunix/serial.c
@@ -26,7 +26,7 @@
#include "uucp.h"
#if USE_RCS_ID
-const char serial_rcsid[] = "$Id: serial.c,v 1.65 1995/08/10 00:53:54 ian Rel $";
+const char serial_rcsid[] = "$Id: serial.c,v 1.6 1995/08/19 21:25:56 ache Exp $";
#endif
#include "uudefs.h"
@@ -2371,7 +2371,7 @@ fsysdep_conn_read (qconn, zbuf, pclen, cmin, ctimeout, freport)
else
csleepchars = MAX_INPUT - 10;
- isleep = (int) (((long) csleepchars * 10000L) / q->ibaud);
+ isleep = (int) (((long) csleepchars * 10000L) / (q->ibaud? q->ibaud: (long)1200));
isleep -= 10;
if (isleep > 10)
@@ -2773,8 +2773,8 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
/ baud bits/sec)
* 10 bits/byte)
*/
- stime.tv_sec = (long) 10240 / q->ibaud;
- stime.tv_usec = ((((long) 1024000000 / q->ibaud) * (long) 10)
+ stime.tv_sec = (long) 10240 / (q->ibaud? q->ibaud: (long)1200);
+ stime.tv_usec = ((((long) 1024000000 / (q->ibaud? q->ibaud: (long)1200)) * (long) 10)
% (long) 1000000);
imask = 1 << q->o;
@@ -2846,7 +2846,7 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
we don't need to use the catch stuff, since we know
that HAVE_RESTARTABLE_SYSCALLS is 0. */
usset_signal (SIGALRM, usalarm, TRUE, (boolean *) NULL);
- alarm ((int) ((long) 10240 / q->ibaud) + 1);
+ alarm ((int) ((long) 10240 / (q->ibaud? q->ibaud: (long)1200)) + 1);
/* There is a race condition here: on a severely loaded
system, we could get the alarm before we start the