forked from Imagelibrary/rtems
2003-08-05 Till Strauman <strauman@slac.stanford.edu>
PR 436/rtems_misc * monitor/mon-monitor.c: monitor registered commands list manipulation bugs
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2003-08-05 Till Strauman <strauman@slac.stanford.edu>
|
||||||
|
|
||||||
|
PR 436/rtems_misc
|
||||||
|
* monitor/mon-monitor.c: monitor registered commands list manipulation bugs
|
||||||
|
|
||||||
2003-07-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2003-07-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* configure.ac: Remove (Merged into ../configure.ac).
|
* configure.ac: Remove (Merged into ../configure.ac).
|
||||||
|
|||||||
@@ -428,22 +428,16 @@ rtems_monitor_insert_cmd (
|
|||||||
rtems_monitor_command_entry_t *command
|
rtems_monitor_command_entry_t *command
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_monitor_command_entry_t *p = rtems_registered_commands.next;
|
rtems_monitor_command_entry_t **p = &rtems_registered_commands.next;
|
||||||
|
|
||||||
command->next = 0;
|
command->next = 0;
|
||||||
|
|
||||||
if (rtems_registered_commands.next)
|
while (*p) {
|
||||||
{
|
if ( STREQ(command->command, (*p)->command) )
|
||||||
for (; p->next; p = p->next)
|
|
||||||
{
|
|
||||||
if (STREQ(command->command, p->command))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
p = & (*p)->next;
|
||||||
}
|
}
|
||||||
p->next = command;
|
*p = command;
|
||||||
}
|
|
||||||
else
|
|
||||||
rtems_registered_commands.next = command;
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,22 +446,18 @@ rtems_monitor_erase_cmd (
|
|||||||
rtems_monitor_command_entry_t *command
|
rtems_monitor_command_entry_t *command
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_monitor_command_entry_t *p;
|
rtems_monitor_command_entry_t **p = & rtems_registered_commands.next;
|
||||||
rtems_monitor_command_entry_t **p_prev = &rtems_registered_commands.next;
|
|
||||||
|
|
||||||
if (rtems_registered_commands.next)
|
while (*p) {
|
||||||
{
|
if ( STREQ(command->command, (*p)->command) ) {
|
||||||
for (p = rtems_registered_commands.next; p->next; p = p->next)
|
*p = (*p)->next;
|
||||||
{
|
command->next = 0;
|
||||||
if (STREQ(command->command, p->command))
|
|
||||||
{
|
|
||||||
*p_prev = p->next;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
p_prev = &p->next;
|
p = & (*p)->next;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user