コード例 #1
0
ファイル: termios.c プロジェクト: epicsdeb/rtems
/*
 * Process input character, with semaphore.
 */
static int
siproc (unsigned char c, struct rtems_termios_tty *tty)
{
	int i;

	/*
	 * Obtain output semaphore if character will be echoed
	 */
	if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
		rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
		i = iproc (c, tty);
		rtems_semaphore_release (tty->osem);
	}
	else {
		i = iproc (c, tty);
	}
	return i;
}
コード例 #2
0
ファイル: termios.c プロジェクト: jingfenglanyun/rtems
/*
 * Process input character, with semaphore.
 */
static int
siproc (unsigned char c, struct rtems_termios_tty *tty)
{
  int i;

  /*
   * Obtain output semaphore if character will be echoed
   */
  if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
    rtems_status_code sc;
    sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
    if (sc != RTEMS_SUCCESSFUL)
      rtems_fatal_error_occurred (sc);
    i = iproc (c, tty);
    sc = rtems_semaphore_release (tty->osem);
    if (sc != RTEMS_SUCCESSFUL)
      rtems_fatal_error_occurred (sc);
  }
  else {
    i = iproc (c, tty);
  }
  return i;
}