Patch from Eric Norum:

I fixed the problems noted by Victor Vengerov.

    1) Fix typo in cfsetispeed().
    2) In rtems_termios_open, ensure that args->iop->data1 is set before calling
    device-specific open routine.
This commit is contained in:
Joel Sherrill
1998-09-21 00:01:26 +00:00
parent 6bd0fe402d
commit 30ba7529f1
4 changed files with 7 additions and 22 deletions

View File

@@ -285,20 +285,15 @@ rtems_termios_open (
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
/*
* Device-specific open
*/
if (tty->device.firstOpen)
(*tty->device.firstOpen)(major, minor, arg);
/*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
}
tty->refcount++;
args->iop->data1 = tty;
if (!tty->refcount++ && tty->device.firstOpen)
(*tty->device.firstOpen)(major, minor, arg);
rtems_semaphore_release (ttyMutex);
return RTEMS_SUCCESSFUL;
}

View File

@@ -47,7 +47,7 @@ cfsetispeed(struct termios *tp, speed_t speed)
errno = EINVAL;
return -1;
}
tp->c_cflag = (tp->c_cflag & ~CBAUD) | (speed * (CIBAUD / CBAUD));
tp->c_cflag = (tp->c_cflag & ~CIBAUD) | (speed * (CIBAUD / CBAUD));
return 0;
}

View File

@@ -285,20 +285,15 @@ rtems_termios_open (
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
/*
* Device-specific open
*/
if (tty->device.firstOpen)
(*tty->device.firstOpen)(major, minor, arg);
/*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
}
tty->refcount++;
args->iop->data1 = tty;
if (!tty->refcount++ && tty->device.firstOpen)
(*tty->device.firstOpen)(major, minor, arg);
rtems_semaphore_release (ttyMutex);
return RTEMS_SUCCESSFUL;
}

View File

@@ -285,20 +285,15 @@ rtems_termios_open (
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
/*
* Device-specific open
*/
if (tty->device.firstOpen)
(*tty->device.firstOpen)(major, minor, arg);
/*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
}
tty->refcount++;
args->iop->data1 = tty;
if (!tty->refcount++ && tty->device.firstOpen)
(*tty->device.firstOpen)(major, minor, arg);
rtems_semaphore_release (ttyMutex);
return RTEMS_SUCCESSFUL;
}