Changeset c00b80c1 in rtems


Ignore:
Timestamp:
Jul 5, 2010, 9:31:56 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
95cf41e
Parents:
15bf747
Message:

2010-07-05 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/getlogin.c: Formatting. Add EFAULT.
  • libcsupport/src/termios.c: Formatting.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r15bf747 rc00b80c1  
     12010-07-05      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libcsupport/src/getlogin.c: Formatting.  Add EFAULT.
     4        * libcsupport/src/termios.c: Formatting.
     5
    162010-07-04      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • cpukit/libcsupport/src/getlogin.c

    r15bf747 rc00b80c1  
    2020#include <pwd.h>
    2121
    22 /*PAGE
    23  *
     22/*
    2423 *  4.2.4 Get User Name, P1003.1b-1993, p. 87
    2524 *
    2625 *  NOTE:  P1003.1c/D10, p. 49 adds getlogin_r().
    2726 */
    28 
    29 /*
    30  * MACRO in userenv.h
    31  *
    32 static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
    33 */
    34 
    3527char *getlogin( void )
    3628{
     
    3931}
    4032
    41 /*PAGE
    42  *
     33/*
    4334 *  4.2.4 Get User Name, P1003.1b-1993, p. 87
    4435 *
    4536 *  NOTE:  P1003.1c/D10, p. 49 adds getlogin_r().
    4637 */
    47 
    4838int getlogin_r(
    4939  char   *name,
     
    5242{
    5343  struct passwd *pw;
     44
     45  if ( !name )
     46    return EFAULT;
     47
    5448  if ( namesize < LOGIN_NAME_MAX )
    5549    return ERANGE;
    5650
    57   pw=getpwuid(getuid());
    58   if (!pw) {
    59    strcpy(name,"");
     51  pw = getpwuid(getuid());
     52  if ( !pw ) {
     53   strcpy( name, "" );
    6054  } else {
    61    strncpy(name,pw->pw_name,LOGIN_NAME_MAX);
    62   };
     55   strncpy( name, pw->pw_name, LOGIN_NAME_MAX );
     56  }
    6357  return 0;
    6458}
  • cpukit/libcsupport/src/termios.c

    r15bf747 rc00b80c1  
    6161    NULL,  NULL,  NULL,  NULL }
    6262/*
    63  * FIXME: change rtems_termios_linesw entries consistant with rtems_termios_linesw entry usage...
     63 * FIXME: change rtems_termios_linesw entries consistent
     64 *        with rtems_termios_linesw entry usage...
    6465 */
    6566struct  rtems_termios_linesw rtems_termios_linesw[MAXLDISC] =
     
    6768  NODISC(0),    /* 0- termios-built-in */
    6869  NODISC(1),    /* 1- defunct */
    69   NODISC(2),              /* 2- NTTYDISC */
     70  NODISC(2),    /* 2- NTTYDISC */
    7071  NODISC(3),    /* TABLDISC */
    7172  NODISC(4),    /* SLIPDISC */
     
    7576};
    7677
    77 int  rtems_termios_nlinesw = sizeof (rtems_termios_linesw) / sizeof (rtems_termios_linesw[0]);
     78int  rtems_termios_nlinesw =
     79       sizeof (rtems_termios_linesw) / sizeof (rtems_termios_linesw[0]);
    7880
    7981extern struct rtems_termios_tty *rtems_termios_ttyHead;
     
    112114  void                          *arg,
    113115  const rtems_termios_callbacks *callbacks
    114   )
     116)
    115117{
    116118  rtems_status_code sc;
     
    121123   * See if the device has already been opened
    122124   */
    123   sc = rtems_semaphore_obtain (rtems_termios_ttyMutex,
    124             RTEMS_WAIT, RTEMS_NO_TIMEOUT);
     125  sc = rtems_semaphore_obtain(
     126    rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
    125127  if (sc != RTEMS_SUCCESSFUL)
    126128    return sc;
     129
    127130  for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
    128131    if ((tty->major == major) && (tty->minor == minor))
    129132      break;
    130133  }
     134
    131135  if (tty == NULL) {
    132136    static char c = 'a';
     
    308312  if (!tty->refcount++) {
    309313    if (tty->device.firstOpen)
    310     (*tty->device.firstOpen)(major, minor, arg);
     314      (*tty->device.firstOpen)(major, minor, arg);
     315
    311316    /*
    312317     * start I/O tasks, if needed
    313318     */
    314319    if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
    315       sc = rtems_task_start(tty->rxTaskId,
    316           rtems_termios_rxdaemon,
    317           (rtems_task_argument)tty);
     320      sc = rtems_task_start(
     321        tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty);
    318322      if (sc != RTEMS_SUCCESSFUL)
    319323        rtems_fatal_error_occurred (sc);
    320324
    321       sc = rtems_task_start(tty->txTaskId,
    322           rtems_termios_txdaemon,
    323           (rtems_task_argument)tty);
     325      sc = rtems_task_start(
     326        tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
    324327      if (sc != RTEMS_SUCCESSFUL)
    325328        rtems_fatal_error_occurred (sc);
     
    344347      tty->rawOutBufState = rob_wait;
    345348      rtems_interrupt_enable (level);
    346       sc = rtems_semaphore_obtain (tty->rawOutBuf.Semaphore,
    347               RTEMS_WAIT,
    348               RTEMS_NO_TIMEOUT);
     349      sc = rtems_semaphore_obtain(
     350        tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
    349351      if (sc != RTEMS_SUCCESSFUL)
    350352        rtems_fatal_error_occurred (sc);
     
    372374       */
    373375      sc = rtems_termios_linesw[tty->t_line].l_close(tty);
    374     }
    375     else {
     376    } else {
    376377      /*
    377378       * default: just flush output buffer
    378379       */
    379       sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
     380      sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
    380381      if (sc != RTEMS_SUCCESSFUL) {
    381382        rtems_fatal_error_occurred (sc);
    382383      }
    383             drainOutput (tty);
    384     }
    385 
    386     if (tty->device.outputUsesInterrupts
    387         == TERMIOS_TASK_DRIVEN) {
     384      drainOutput (tty);
     385    }
     386
     387    if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
    388388      /*
    389389       * send "terminate" to I/O tasks
    390390       */
    391       sc = rtems_event_send(
    392                                   tty->rxTaskId,
    393           TERMIOS_RX_TERMINATE_EVENT);
     391      sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT );
    394392      if (sc != RTEMS_SUCCESSFUL)
    395393        rtems_fatal_error_occurred (sc);
    396       sc = rtems_event_send(
    397                                   tty->txTaskId,
    398           TERMIOS_TX_TERMINATE_EVENT);
     394      sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
    399395      if (sc != RTEMS_SUCCESSFUL)
    400396        rtems_fatal_error_occurred (sc);
     
    407403        rtems_termios_ttyTail->forw = NULL;
    408404      }
    409     }
    410     else {
     405    } else {
    411406      tty->forw->back = tty->back;
    412407    }
     408
    413409    if (tty->back == NULL) {
    414410      rtems_termios_ttyHead = tty->forw;
     
    416412        rtems_termios_ttyHead->back = NULL;
    417413      }
    418     }
    419     else {
     414    } else {
    420415      tty->back->forw = tty->forw;
    421416    }
     417
    422418    rtems_semaphore_delete (tty->isem);
    423419    rtems_semaphore_delete (tty->osem);
     
    468464      /* check for chars in output buffer (or rob_state?) */
    469465      if (tty->rawOutBufState != rob_idle) {
    470   /* if chars available, call write function... */
    471   (*tty->device.write)(tty->minor,
    472          &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
     466        /* if chars available, call write function... */
     467        (*tty->device.write)(
     468          tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
    473469      }
    474470      /* reenable interrupts */
     
    477473  }
    478474  /* check for incoming XON/XOFF flow control switched off */
    479   if (( tty->flow_ctrl & FL_MDXOF) &&
    480       !(tty->termios.c_iflag & IXOFF)) {
     475  if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) {
    481476    /* clear related flags in flow_ctrl */
    482477    tty->flow_ctrl &= ~(FL_MDXOF);
     
    552547      tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
    553548      tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
    554     }
    555     else {
     549    } else {
    556550      tty->vtimeTicks = tty->termios.c_cc[VTIME] *
    557551                    rtems_clock_get_ticks_per_second() / 10;
     
    563557        else
    564558          tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
    565       }
    566       else {
     559      } else {
    567560        if (tty->termios.c_cc[VMIN]) {
    568561          tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
    569562          tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
    570563          tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
    571         }
    572         else {
     564        } else {
    573565          tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
    574566        }
     
    616608    break;
    617609#endif
    618    case FIONREAD:
    619     {
    620     int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
    621     if ( rawnc < 0 )
    622       rawnc += tty->rawInBuf.Size;
    623     /* Half guess that this is the right operation */
    624     *(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
     610   case FIONREAD: {
     611      int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
     612      if ( rawnc < 0 )
     613        rawnc += tty->rawInBuf.Size;
     614      /* Half guess that this is the right operation */
     615      *(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
    625616    }
    626617    break;
    627618  }
     619
    628620  rtems_semaphore_release (tty->osem);
    629621  args->ioctl_return = sc;
     
    666658      tty->rawOutBufState = rob_wait;
    667659      rtems_interrupt_enable (level);
    668       sc = rtems_semaphore_obtain (tty->rawOutBuf.Semaphore,
    669               RTEMS_WAIT,
    670               RTEMS_NO_TIMEOUT);
     660      sc = rtems_semaphore_obtain(
     661        tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
    671662      if (sc != RTEMS_SUCCESSFUL)
    672663        rtems_fatal_error_occurred (sc);
     
    680671        (*tty->device.write)(tty->minor,
    681672      (char *)&tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
    682       }
    683       else {
     673      } else {
    684674        /* remember that output has been stopped due to flow ctrl*/
    685675        tty->flow_ctrl |= FL_OSTOP;
     
    770760      oproc (*buffer++, tty);
    771761    args->bytes_moved = args->count;
    772   }
    773   else {
     762  } else {
    774763    rtems_termios_puts (args->buffer, args->count, tty);
    775764    args->bytes_moved = args->count;
     
    785774echo (unsigned char c, struct rtems_termios_tty *tty)
    786775{
    787   if ((tty->termios.c_lflag & ECHOCTL) && iscntrl(c) && (c != '\t') && (c != '\n')) {
     776  if ((tty->termios.c_lflag & ECHOCTL) &&
     777       iscntrl(c) && (c != '\t') && (c != '\n')) {
    788778    char echobuf[2];
    789779
     
    792782    rtems_termios_puts (echobuf, 2, tty);
    793783    tty->column += 2;
    794   }
    795   else {
     784  } else {
    796785    oproc (c, tty);
    797786  }
     
    821810    }
    822811  }
     812
    823813  while (tty->ccount) {
    824814    unsigned char c = tty->cbuf[--tty->ccount];
     
    827817      if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
    828818        echo (tty->termios.c_cc[VERASE], tty);
    829       }
    830       else if (c == '\t') {
     819      } else if (c == '\t') {
    831820        int col = tty->read_start_column;
    832821        int i = 0;
     
    839828          if (c == '\t') {
    840829            col = (col | 7) + 1;
    841           }
    842           else if (iscntrl (c)) {
     830          } else if (iscntrl (c)) {
    843831            if (tty->termios.c_lflag & ECHOCTL)
    844832              col += 2;
    845           }
    846           else {
     833          } else {
    847834            col++;
    848835          }
     
    883870  if (tty->termios.c_iflag & ISTRIP)
    884871    c &= 0x7f;
     872
    885873  if (tty->termios.c_iflag & IUCLC)
    886874    c = tolower (c);
     875
    887876  if (c == '\r') {
    888877    if (tty->termios.c_iflag & IGNCR)
     
    890879    if (tty->termios.c_iflag & ICRNL)
    891880      c = '\n';
    892   }
    893   else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
     881  } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
    894882    c = '\r';
    895883  }
     884
    896885  if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
    897886    if (c == tty->termios.c_cc[VERASE]) {
     
    905894    else if (c == tty->termios.c_cc[VEOF]) {
    906895      return 1;
    907     }
    908     else if (c == '\n') {
     896    } else if (c == '\n') {
    909897      if (tty->termios.c_lflag & (ECHO | ECHONL))
    910898        echo (c, tty);
    911899      tty->cbuf[tty->ccount++] = c;
    912900      return 1;
    913     }
    914     else if ((c == tty->termios.c_cc[VEOL])
    915           || (c == tty->termios.c_cc[VEOL2])) {
     901    } else if ((c == tty->termios.c_cc[VEOL]) ||
     902               (c == tty->termios.c_cc[VEOL2])) {
    916903      if (tty->termios.c_lflag & ECHO)
    917904        echo (c, tty);
     
    967954      if (n < 0) {
    968955        rtems_task_wake_after (1);
    969       }
    970       else {
     956      } else {
    971957        if  (siproc (n, tty))
    972958          break;
    973959      }
    974960    }
    975   }
    976   else {
     961  } else {
    977962    rtems_interval then, now;
     963
    978964    then = rtems_clock_get_ticks_since_boot();
    979965    for (;;) {
     
    987973            }
    988974          }
    989         }
    990         else {
     975        } else {
    991976          if (!tty->termios.c_cc[VTIME])
    992977            break;
     
    997982        }
    998983        rtems_task_wake_after (1);
    999       }
    1000       else {
     984      } else {
    1001985        siproc (n, tty);
    1002986        if (tty->ccount >= tty->termios.c_cc[VMIN])
     
    10421026          || (tty->flow_ctrl & FL_OSTOP))) {
    10431027          /* XON should be sent now... */
    1044           (*tty->device.write)(tty->minor,
    1045         (void *)&(tty->termios.c_cc[VSTART]),
    1046         1);
    1047         }
    1048         else if (tty->flow_ctrl & FL_MDRTS) {
     1028          (*tty->device.write)(
     1029            tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
     1030        } else if (tty->flow_ctrl & FL_MDRTS) {
    10491031          tty->flow_ctrl &= ~FL_IRTSOFF;
    10501032          /* activate RTS line */
     
    10571039      /* continue processing new character */
    10581040      if (tty->termios.c_lflag & ICANON) {
    1059         if  (siproc (c, tty))
     1041        if (siproc (c, tty))
    10601042          wait = 0;
    1061       }
    1062       else {
     1043      } else {
    10631044        siproc (c, tty);
    10641045        if (tty->ccount >= tty->termios.c_cc[VMIN])
     
    10721053     */
    10731054    if ( wait ) {
    1074       sc = rtems_semaphore_obtain (tty->rawInBuf.Semaphore,
    1075         tty->rawInBufSemaphoreOptions,
    1076         timeout);
     1055      sc = rtems_semaphore_obtain(
     1056        tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
    10771057      if (sc != RTEMS_SUCCESSFUL)
    10781058        break;
     
    10941074  if (sc != RTEMS_SUCCESSFUL)
    10951075    return sc;
     1076
    10961077  if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
    10971078    sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
     
    11001081    return sc;
    11011082  }
     1083
    11021084  if (tty->cindex == tty->ccount) {
    11031085    tty->cindex = tty->ccount = 0;
    11041086    tty->read_start_column = tty->column;
    1105     if (tty->device.pollRead != NULL
    1106         && tty->device.outputUsesInterrupts == TERMIOS_POLLED)
     1087    if (tty->device.pollRead != NULL &&
     1088        tty->device.outputUsesInterrupts == TERMIOS_POLLED)
    11071089      sc = fillBufferPoll (tty);
    11081090    else
    11091091      sc = fillBufferQueue (tty);
     1092
    11101093    if (sc != RTEMS_SUCCESSFUL)
    11111094      tty->cindex = tty->ccount = 0;
     
    12001183        /* check for chars in output buffer (or rob_state?) */
    12011184        if (tty->rawOutBufState != rob_idle) {
    1202         /* if chars available, call write function... */
    1203         (*tty->device.write)(tty->minor,
    1204          &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
     1185          /* if chars available, call write function... */
     1186          (*tty->device.write)(
     1187            tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
    12051188        }
    12061189        /* reenable interrupts */
    12071190        rtems_interrupt_enable(level);
    12081191      }
    1209     }
    1210     else {
     1192    } else {
    12111193      newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
    12121194      /* if chars_in_buffer > highwater                */
     
    12271209                (void *)&(tty->termios.c_cc[VSTOP]), 1);
    12281210          }
    1229         }
    1230         else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
     1211        } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
    12311212          tty->flow_ctrl |= FL_IRTSOFF;
    12321213          /* deactivate RTS line */
     
    12421223      if (newTail == tty->rawInBuf.Head) {
    12431224        dropped++;
    1244       }
    1245       else {
     1225      } else {
    12461226        tty->rawInBuf.theBuf[newTail] = c;
    12471227        tty->rawInBuf.Tail = newTail;
     
    12571237    }
    12581238  }
     1239
    12591240  tty->rawInBufDropped += dropped;
    12601241  rtems_semaphore_release (tty->rawInBuf.Semaphore);
     
    12781259      == (FL_MDXOF | FL_IREQXOF)) {
    12791260    /* XOFF should be sent now... */
    1280     (*tty->device.write)(tty->minor,
    1281         (void *)&(tty->termios.c_cc[VSTOP]), 1);
     1261    (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
    12821262
    12831263    rtems_interrupt_disable(level);
     
    12871267
    12881268    nToSend = 1;
    1289   }
    1290   else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
     1269
     1270  } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
    12911271    /* NOTE: send XON even, if no longer in XON/XOFF mode... */
    12921272    /* XON should be sent now... */
     
    12971277     * Therefore the dequeue "length" should be reduced by 1
    12981278     */
    1299     (*tty->device.write)(tty->minor,
    1300              (void *)&(tty->termios.c_cc[VSTART]), 1);
     1279    (*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
    13011280
    13021281    rtems_interrupt_disable(level);
     
    13061285
    13071286    nToSend = 1;
    1308   }
    1309   else {
     1287  } else {
    13101288    if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
    13111289      /*
     
    13341312      rtems_semaphore_release (tty->rawOutBuf.Semaphore);
    13351313    }
     1314
    13361315    if (newTail == tty->rawOutBuf.Head) {
    13371316      /*
     
    13581337      rtems_interrupt_enable(level);
    13591338      nToSend = 0;
    1360     }
    1361     else {
     1339    } else {
    13621340      /*
    13631341       * Buffer not empty, start tranmitter
     
    13741352      }
    13751353      tty->rawOutBufState = rob_busy; /*apm*/
    1376       (*tty->device.write)(tty->minor,
    1377          &tty->rawOutBuf.theBuf[newTail],
    1378          nToSend);
     1354      (*tty->device.write)(
     1355        tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
    13791356    }
    13801357    tty->rawOutBuf.Tail = newTail; /*apm*/
     
    14071384     * send wake up to transmitter task
    14081385     */
    1409     sc = rtems_event_send(tty->txTaskId,
    1410               TERMIOS_TX_START_EVENT);
     1386    sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
    14111387    if (sc != RTEMS_SUCCESSFUL)
    14121388      rtems_fatal_error_occurred (sc);
     
    14391415     * wait for rtems event
    14401416     */
    1441     rtems_event_receive((TERMIOS_TX_START_EVENT |
    1442              TERMIOS_TX_TERMINATE_EVENT),
    1443             RTEMS_EVENT_ANY | RTEMS_WAIT,
    1444             RTEMS_NO_TIMEOUT,
    1445             &the_event);
     1417    rtems_event_receive(
     1418       (TERMIOS_TX_START_EVENT | TERMIOS_TX_TERMINATE_EVENT),
     1419       RTEMS_EVENT_ANY | RTEMS_WAIT,
     1420       RTEMS_NO_TIMEOUT,
     1421       &the_event
     1422    );
    14461423    if ((the_event & TERMIOS_TX_TERMINATE_EVENT) != 0) {
    14471424      tty->txTaskId = 0;
    14481425      rtems_task_delete(RTEMS_SELF);
    14491426    }
    1450     else {
    1451       /*
    1452        * call any line discipline start function
    1453        */
    1454       if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
    1455         rtems_termios_linesw[tty->t_line].l_start(tty);
    1456       }
    1457       /*
    1458        * try to push further characters to device
    1459        */
    1460       rtems_termios_refill_transmitter(tty);
    1461     }
     1427
     1428    /*
     1429     * call any line discipline start function
     1430     */
     1431    if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
     1432      rtems_termios_linesw[tty->t_line].l_start(tty);
     1433    }
     1434
     1435    /*
     1436     * try to push further characters to device
     1437     */
     1438    rtems_termios_refill_transmitter(tty);
    14621439  }
    14631440}
     
    14721449  int c;
    14731450  char c_buf;
     1451
    14741452  while (1) {
    14751453    /*
    14761454     * wait for rtems event
    14771455     */
    1478     rtems_event_receive((TERMIOS_RX_PROC_EVENT |
    1479              TERMIOS_RX_TERMINATE_EVENT),
    1480             RTEMS_EVENT_ANY | RTEMS_WAIT,
    1481             RTEMS_NO_TIMEOUT,
    1482             &the_event);
     1456    rtems_event_receive(
     1457      (TERMIOS_RX_PROC_EVENT | TERMIOS_RX_TERMINATE_EVENT),
     1458      RTEMS_EVENT_ANY | RTEMS_WAIT,
     1459      RTEMS_NO_TIMEOUT,
     1460      &the_event
     1461    );
    14831462    if ((the_event & TERMIOS_RX_TERMINATE_EVENT) != 0) {
    14841463      tty->rxTaskId = 0;
    14851464      rtems_task_delete(RTEMS_SELF);
    14861465    }
    1487     else {
     1466
     1467    /*
     1468     * do something
     1469     */
     1470    c = tty->device.pollRead(tty->minor);
     1471    if (c != EOF) {
    14881472      /*
    1489        * do something
     1473       * pollRead did call enqueue on its own
    14901474       */
    1491       c = tty->device.pollRead(tty->minor);
    1492       if (c != EOF) {
    1493         /*
    1494          * pollRead did call enqueue on its own
    1495          */
    1496         c_buf = c;
    1497         rtems_termios_enqueue_raw_characters (
    1498               tty,&c_buf,1);
    1499       }
    1500     }
    1501   }
    1502 }
     1475      c_buf = c;
     1476      rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
     1477    }
     1478  }
     1479}
Note: See TracChangeset for help on using the changeset viewer.