summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/speed.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-12-07 13:36:03 +0000
committerUlrich Drepper <drepper@redhat.com>1998-12-07 13:36:03 +0000
commit5470bc9f78247e48e50ce471a7939390c0f0639e (patch)
tree8ef0185b6d049f2597c2192f2339691b36f018ed /sysdeps/unix/sysv/linux/speed.c
parentc882585fc83ce93f22b838cc1497118efe83ddfd (diff)
downloadglibc-5470bc9f78247e48e50ce471a7939390c0f0639e.tar.gz
glibc-5470bc9f78247e48e50ce471a7939390c0f0639e.tar.xz
glibc-5470bc9f78247e48e50ce471a7939390c0f0639e.zip
Update.
1998-12-07  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/speed.c (cfsetispeed): Make a real
	function.  Don't set speed is SPEED parameter is zero since this
	means set it to the output speed.

	* version.h (VERSION): Bump to 2.0.106.

1998-12-07 12:06  Ulrich Drepper  <drepper@cygnus.com>

	* po/de.po: Update from translation team.
	* po/ko.po: Likewise.

1998-12-07  Richard Henderson  <rth@cygnus.com>

	* sysdeps/unix/sysv/linux/alpha/select.S: Save a4 through
	both paths.
Diffstat (limited to 'sysdeps/unix/sysv/linux/speed.c')
-rw-r--r--sysdeps/unix/sysv/linux/speed.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/speed.c b/sysdeps/unix/sysv/linux/speed.c
index 6a1b243da5..a0aefd805a 100644
--- a/sysdeps/unix/sysv/linux/speed.c
+++ b/sysdeps/unix/sysv/linux/speed.c
@@ -1,5 +1,5 @@
 /* `struct termios' speed frobnication functions.  Linux version.
-   Copyright (C) 1991, 92, 93, 95, 96, 97 Free Software Foundation, Inc.
+   Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -54,5 +54,26 @@ cfsetospeed  (termios_p, speed)
 }
 
 /* Set the input baud rate stored in *TERMIOS_P to SPEED.
-   For Linux there is no difference between input and output speed.  */
-strong_alias (cfsetospeed, cfsetispeed);
+   Although for Linux there is no difference between input and output
+   speed, the numerical 0 is a special case for the input baud rate.  It
+   should set the input baud rate to the output baud rate.  */
+int
+cfsetispeed (termios_p, speed)
+     struct termios *termios_p;
+     speed_t speed;
+{
+  if ((speed & ~CBAUD) != 0
+      && (speed < B57600 || speed > B460800))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  if (speed != 0)
+    {
+      termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
+      termios_p->c_cflag |= speed;
+    }
+
+  return 0;
+}