Changeset 10ec9ae in rtems


Ignore:
Timestamp:
08/05/03 19:06:56 (20 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Children:
3605c4e
Parents:
8ae3c6e8
Message:

2003-08-05 Till Strauman <strauman@…>

PR 436/rtems_misc

  • monitor/mon-monitor.c: monitor registered commands list manipulation bugs
Location:
cpukit/libmisc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/ChangeLog

    r8ae3c6e8 r10ec9ae  
     12003-08-05      Till Strauman <strauman@slac.stanford.edu>
     2
     3        PR 436/rtems_misc
     4        * monitor/mon-monitor.c: monitor registered commands list manipulation bugs
     5
    162003-07-08      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    27
  • cpukit/libmisc/monitor/mon-monitor.c

    r8ae3c6e8 r10ec9ae  
    429429)
    430430{
    431     rtems_monitor_command_entry_t *p = rtems_registered_commands.next;
     431    rtems_monitor_command_entry_t **p =  &rtems_registered_commands.next;
    432432
    433433    command->next = 0;
    434434
    435     if (rtems_registered_commands.next)
    436     {
    437         for (; p->next; p = p->next)
    438         {
    439             if (STREQ(command->command, p->command))
    440                 return 0;
    441         }
    442         p->next = command;
    443     }
    444     else
    445         rtems_registered_commands.next = command;
    446  
     435    while (*p) {
     436        if ( STREQ(command->command, (*p)->command) )
     437            return 0;
     438        p = & (*p)->next;
     439    }
     440    *p = command;
    447441    return 1;
    448442}
     
    453447)
    454448{
    455     rtems_monitor_command_entry_t *p;
    456     rtems_monitor_command_entry_t **p_prev = &rtems_registered_commands.next;
    457 
    458     if (rtems_registered_commands.next)
    459     {
    460         for (p = rtems_registered_commands.next; p->next; p = p->next)
    461         {
    462             if (STREQ(command->command, p->command))
    463             {
    464                 *p_prev = p->next;
    465                 return 1;
    466             }
    467             p_prev = &p->next;
     449    rtems_monitor_command_entry_t **p = & rtems_registered_commands.next;
     450                                                                               
     451    while (*p) {
     452        if ( STREQ(command->command, (*p)->command) ) {
     453            *p = (*p)->next;
     454            command->next = 0;
     455            return 1;
    468456        }
     457        p = & (*p)->next;
    469458    }
    470459    return 0;
     460
    471461}
    472462
Note: See TracChangeset for help on using the changeset viewer.