Changeset e3c15fb in rtems-schedsim


Ignore:
Timestamp:
May 27, 2014, 3:20:40 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
master
Children:
ea855c1
Parents:
ee66622
git-author:
Joel Sherrill <joel.sherrill@…> (05/27/14 15:20:40)
git-committer:
Joel Sherrill <joel.sherrill@…> (05/27/14 15:20:51)
Message:

schedsim.c: Verify status of 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • schedsim/shell/shared/schedsim.c

    ree66622 re3c15fb  
    6060  while ( 1 ) {
    6161    cStatus = fgets( buffer, sizeof(buffer), script );
    62     if ( cStatus == NULL )
     62    if ( cStatus == NULL ) {
     63      sc = 0;
    6364      break;
     65    }
     66
    6467    // If the last line does not have a CR, then we don't want to
    6568    // arbitrarily clobber an = instead of a \n.
    6669    length = strlen(buffer);
    67     if ( buffer[ length - 1] == '\n' )
     70    if ( buffer[ length - 1] == '\n' ) {
    6871      buffer[ length - 1] = '\0';
     72    }
    6973
    70     if ( verbose )
     74    if ( verbose ) {
    7175      printf( "==> %d: %s\n", ++ScriptFileLine, buffer );
     76    }
    7277
    73     if ( buffer[0] == '#' )
     78    if ( buffer[0] == '#' ) {
    7479      continue;
     80    }
    7581
    7682    for ( c = buffer ; *c ; c++ ) {
     
    8086
    8187    if (!strcmp(c,"bye") || !strcmp(c,"exit")) {
    82       exit( 0 );
     88      sc = 0;
     89      break;
    8390    }
    8491
     
    8895    }
    8996
    90     if ( argc == 0 )
     97    if ( argc == 0 ) {
    9198      continue;
     99    }
    92100
    93101    shell_cmd = rtems_shell_lookup_cmd(argv[0]);
    94102    if ( !shell_cmd ) {
    95103      fprintf(stderr, "%s is unknown command\n", c );
    96       exit( 1 );
     104      sc = 1;
     105      break;
    97106    }
    98107
     
    100109    if ( sc != 0 ) {
    101110      fprintf( stderr, "ERROR: Command %s returned %d\n", argv[0], sc );
    102       exit( sc );
     111      break;
    103112    }
    104113  }
     114
     115  return sc;
    105116}
    106117
Note: See TracChangeset for help on using the changeset viewer.