Changeset 9d773936 in rtems


Ignore:
Timestamp:
Mar 12, 2008, 4:20:07 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
bd7a91b
Parents:
66a9381d
Message:

2008-03-12 Joel Sherrill <joel.sherrill@…>

  • libmisc/shell/cmds.c: Directly register the command structure to avoid unnecessary duplication of static strings. We know best this time.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r66a9381d r9d773936  
     12008-03-12      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libmisc/shell/cmds.c: Directly register the command structure to
     4        avoid unnecessary duplication of static strings. We know best this
     5        time.
     6
    172008-03-11      Joel Sherrill <joel.sherrill@OARcorp.com>
    28
  • cpukit/libmisc/shell/cmds.c

    r66a9381d r9d773936  
    1919#include <stdio.h>
    2020#include <string.h>
     21#include <stdlib.h>
    2122
    2223#include <rtems.h>
     
    4142{
    4243  rtems_monitor_command_entry_t *command;
     44
    4345  /* monitor topic */
    4446  command = rtems_monitor_commands;
     47
    4548  while (command) {
    46    if (strcmp("exit",command->command)) /* Exclude EXIT (alias quit)*/
    47      rtems_shell_add_cmd(command->command,"monitor",
    48                          command->usage,rtems_shell_main_monitor);
     49   /* Exclude EXIT (alias quit)*/
     50   if (strcmp("exit",command->command)) {
     51     rtems_shell_cmd_t *shell_cmd;
     52
     53     shell_cmd = (rtems_shell_cmd_t *) malloc(sizeof(rtems_shell_cmd_t));
     54     shell_cmd->name    = command->command;
     55     shell_cmd->topic   = "monitor";
     56     shell_cmd->usage   = command->usage;
     57     shell_cmd->command = rtems_shell_main_monitor;
     58     shell_cmd->alias   = (rtems_shell_cmd_t *) NULL;
     59     shell_cmd->next    = (rtems_shell_cmd_t *) NULL;
     60
     61       if (rtems_shell_add_cmd_struct( shell_cmd ) == NULL) {
     62         free( shell_cmd );
     63         shell_cmd = NULL;
     64       }
     65     }
    4966     command = command->next;
    5067  }
Note: See TracChangeset for help on using the changeset viewer.