diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-11-29 12:12:39 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-11-29 12:12:39 +0000 |
commit | 0893220b2a4507fc2619b625ecb0d6241ef5cd6f (patch) | |
tree | 1f81a1c1fac15dc8f3cd86aef65cbcf261f01a97 /cpukit/libmisc | |
parent | Whitespace removal. (diff) | |
download | rtems-0893220b2a4507fc2619b625ecb0d6241ef5cd6f.tar.bz2 |
Whitespace removal.
Diffstat (limited to 'cpukit/libmisc')
53 files changed, 281 insertions, 281 deletions
diff --git a/cpukit/libmisc/bspcmdline/bspcmdline_getparam.c b/cpukit/libmisc/bspcmdline/bspcmdline_getparam.c index 1a2f0fa839..3c416a3e9c 100644 --- a/cpukit/libmisc/bspcmdline/bspcmdline_getparam.c +++ b/cpukit/libmisc/bspcmdline/bspcmdline_getparam.c @@ -42,16 +42,16 @@ const char *rtems_bsp_cmdline_get_param( ) { const char *p; - + if ( !name ) return NULL; - + if ( !value ) return NULL; - + if ( !length ) return NULL; - + value[0] = '\0'; p = rtems_bsp_cmdline_get_param_raw( name ); diff --git a/cpukit/libmisc/bspcmdline/bspcmdline_getparamraw.c b/cpukit/libmisc/bspcmdline/bspcmdline_getparamraw.c index 4759a96228..cbba5e7337 100644 --- a/cpukit/libmisc/bspcmdline/bspcmdline_getparamraw.c +++ b/cpukit/libmisc/bspcmdline/bspcmdline_getparamraw.c @@ -23,7 +23,7 @@ const char *rtems_bsp_cmdline_get_param_raw( if ( !name ) return NULL; - + if ( !bsp_boot_cmdline ) return NULL; diff --git a/cpukit/libmisc/bspcmdline/bspcmdline_getparamrhs.c b/cpukit/libmisc/bspcmdline/bspcmdline_getparamrhs.c index 1445d434e3..2e9e9608c9 100644 --- a/cpukit/libmisc/bspcmdline/bspcmdline_getparamrhs.c +++ b/cpukit/libmisc/bspcmdline/bspcmdline_getparamrhs.c @@ -37,6 +37,6 @@ const char *rtems_bsp_cmdline_get_param_rhs( if ( *(d-1) == '\"' ) d--; *d = '\0'; - + return value; } diff --git a/cpukit/libmisc/capture/capture-cli.c b/cpukit/libmisc/capture/capture-cli.c index c3b20f4269..fb9dc45e84 100644 --- a/cpukit/libmisc/capture/capture-cli.c +++ b/cpukit/libmisc/capture/capture-cli.c @@ -311,7 +311,7 @@ rtems_capture_cli_task_load_thread (rtems_task_argument arg __attribute__((unuse rtems_task_priority ceiling = rtems_capture_watch_get_ceiling (); rtems_task_priority floor = rtems_capture_watch_get_floor (); int last_count = 0; - + for (;;) { rtems_capture_task_t* tasks[RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS + 1]; @@ -431,14 +431,14 @@ rtems_capture_cli_task_load_thread (rtems_task_argument arg __attribute__((unuse if (count < RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS) { - j = RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS - count; + j = RTEMS_CAPTURE_CLI_MAX_LOAD_TASKS - count; while (j > 0) { fprintf (stdout, "\x1b[K\n"); j--; } } - + last_count = count; cli_load_thread_active = 0; @@ -477,13 +477,13 @@ rtems_capture_cli_task_load (int argc __attribute__((un } name = rtems_build_name('C', 'P', 'l', 't'); - + sc = rtems_task_create (name, priority, 4 * 1024, RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, RTEMS_PREEMPT | RTEMS_TIMESLICE | RTEMS_NO_ASR, &id); - - if (sc != RTEMS_SUCCESSFUL) + + if (sc != RTEMS_SUCCESSFUL) { fprintf (stdout, "error: cannot create helper thread: %s\n", rtems_status_text (sc)); @@ -660,7 +660,7 @@ rtems_capture_cli_get_name_id (char* arg, * remove unless the score has been updated. */ rtems_name rname; - + rname = rtems_build_name(arg[0], arg[1], arg[2], arg[3]); *name = rname; *valid_name = true; @@ -1118,7 +1118,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv) { bool found = false; int t; - + for (t = 0; t < RTEMS_CAPTURE_CLI_TRIGGERS_NUM; t++) if (strcmp (argv[arg], rtems_capture_cli_triggers[t].name) == 0) { @@ -1141,7 +1141,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv) { if (is_from) fprintf (stdout, "warning: extra 'from' ignored\n"); - + is_from = 1; continue; } @@ -1170,7 +1170,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv) else fprintf (stdout, "warning: extra arguments ignored\n"); } - + if (valid_id) { if (is_from) @@ -1200,7 +1200,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv) rtems_capture_cli_triggers[trigger].name); return; } - + if (!to_valid_name && !to_valid_id && !from_valid_name && !from_valid_id) { fprintf (stdout, trigger_set_usage); @@ -1351,7 +1351,7 @@ rtems_capture_cli_trace_records (int argc, * If we have no records then just exist. We still need to release * the reader lock. */ - + if (read == 0) { rtems_capture_release (read); @@ -1359,7 +1359,7 @@ rtems_capture_cli_trace_records (int argc, } count = total < read ? total : read; - + while (count--) { if (csv) @@ -1403,7 +1403,7 @@ rtems_capture_cli_trace_records (int argc, } count = total < read ? total : read; - + if (count < total) total -= count; else diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c index 1fb18d6f9d..fb81811408 100644 --- a/cpukit/libmisc/capture/capture.c +++ b/cpukit/libmisc/capture/capture.c @@ -40,7 +40,7 @@ * watch filters. * * This feature has been disabled as it becomes confusing when - * setting up filters and some event leak. + * setting up filters and some event leak. */ #if defined (RTEMS_CAPTURE_ENGINE_ALLOW_RELATED_EVENTS) #define RTEMS_CAPTURE_RECORD_EVENTS (RTEMS_CAPTURE_CREATED_BY_EVENT | \ @@ -220,7 +220,7 @@ rtems_capture_by_in_to (uint32_t events, uint32_t valid_mask = RTEMS_CAPTURE_CONTROL_FROM_MASK (0); uint32_t valid_remainder = 0xffffffff; int i; - + for (i = 0; i < RTEMS_CAPTURE_TRIGGER_TASKS; i++) { /* @@ -245,11 +245,11 @@ rtems_capture_by_in_to (uint32_t events, by->name, by->id)) return 1; } - + valid_mask >>= 1; valid_remainder >>= 1; } - + return 0; } @@ -400,7 +400,7 @@ rtems_capture_create_capture_task (rtems_tcb* new_task) rtems_capture_task_t* task; rtems_capture_control_t* control; rtems_name name; - + task = _Workspace_Allocate (sizeof (rtems_capture_task_t)); if (task == NULL) @@ -414,9 +414,9 @@ rtems_capture_create_capture_task (rtems_tcb* new_task) */ rtems_object_get_classic_name( new_task->Object.id, &name ); - + rtems_capture_dup_name (&task->name, name); - + task->id = new_task->Object.id; task->flags = 0; task->in = 0; @@ -590,14 +590,14 @@ rtems_capture_trigger (rtems_capture_task_t* ft, uint32_t from_events = 0; uint32_t to_events = 0; uint32_t from_to_events = 0; - + if (ft) { fc = ft->control; if (fc) from_events = fc->from_triggers & events; } - + if (tt) { tc = tt->control; @@ -636,7 +636,7 @@ rtems_capture_trigger (rtems_capture_task_t* ft, return 0; } - + return 1; } @@ -711,7 +711,7 @@ rtems_capture_start_task (rtems_tcb* current_task, if (st == NULL) st = rtems_capture_create_capture_task (started_task); - + if (rtems_capture_trigger (ct, st, RTEMS_CAPTURE_START)) { rtems_capture_record (ct, RTEMS_CAPTURE_STARTED_BY_EVENT); @@ -802,7 +802,7 @@ rtems_capture_delete_task (rtems_tcb* current_task, rtems_capture_record (ct, RTEMS_CAPTURE_DELETED_BY_EVENT); rtems_capture_record (dt, RTEMS_CAPTURE_DELETED_EVENT); } - + rtems_capture_task_stack_usage (dt); /* @@ -1223,7 +1223,7 @@ rtems_capture_flush (bool prime) capture_count = 0; capture_in = capture_records; capture_out = 0; - + rtems_interrupt_enable (level); task = capture_tasks; @@ -1540,7 +1540,7 @@ rtems_capture_set_trigger (rtems_name from_name, * FROM ANY means trigger when the event happens TO this * task. TO ANY means FROM this task. */ - + if (mode == rtems_capture_to_any) { control = rtems_capture_create_control (from_name, from_id); @@ -1559,9 +1559,9 @@ rtems_capture_set_trigger (rtems_name from_name, { bool done = false; int i; - + control->by_triggers |= flags; - + for (i = 0; i < RTEMS_CAPTURE_TRIGGER_TASKS; i++) { if (rtems_capture_control_by_valid (control, i) && @@ -1616,7 +1616,7 @@ rtems_capture_clear_trigger (rtems_name from_name, uint32_t flags; flags = rtems_capture_map_trigger (trigger); - + if (mode == rtems_capture_to_any) { control = rtems_capture_find_control (from_name, from_id); @@ -1643,9 +1643,9 @@ rtems_capture_clear_trigger (rtems_name from_name, { bool done = false; int i; - + control->by_triggers &= ~flags; - + for (i = 0; i < RTEMS_CAPTURE_TRIGGER_TASKS; i++) { if (rtems_capture_control_by_valid (control, i) && @@ -1808,7 +1808,7 @@ rtems_capture_release (uint32_t count) { rtems_capture_record_t* rec; uint32_t counted; - + rtems_interrupt_level level; rtems_interrupt_disable (level); @@ -1819,7 +1819,7 @@ rtems_capture_release (uint32_t count) rtems_interrupt_enable (level); counted = count; - + rec = &capture_records[capture_out]; while (counted--) @@ -1828,7 +1828,7 @@ rtems_capture_release (uint32_t count) rtems_capture_destroy_capture_task (rec->task); rec++; } - + rtems_interrupt_disable (level); capture_count -= count; diff --git a/cpukit/libmisc/cpuuse/cpuusagereport.c b/cpukit/libmisc/cpuuse/cpuusagereport.c index a0f0995756..6d916e1cc0 100644 --- a/cpukit/libmisc/cpuuse/cpuusagereport.c +++ b/cpukit/libmisc/cpuuse/cpuusagereport.c @@ -85,7 +85,7 @@ void rtems_cpu_usage_report_with_plugin( } } #endif - + (*print)( context, "-------------------------------------------------------------------------------\n" @@ -113,7 +113,7 @@ void rtems_cpu_usage_report_with_plugin( continue; rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); - + (*print)( context, " 0x%08" PRIx32 " | %-38s |", diff --git a/cpukit/libmisc/monitor/mon-editor.c b/cpukit/libmisc/monitor/mon-editor.c index a6e46a1f7e..644560699b 100644 --- a/cpukit/libmisc/monitor/mon-editor.c +++ b/cpukit/libmisc/monitor/mon-editor.c @@ -242,7 +242,7 @@ rtems_monitor_line_editor ( extended_key = rtems_monitor_getchar (); c = extended_key & KEYS_NORMAL_MASK; - + /* * Make the extended_key usable as a boolean. */ diff --git a/cpukit/libmisc/monitor/mon-itask.c b/cpukit/libmisc/monitor/mon-itask.c index 4cfaddab38..6dab51a768 100644 --- a/cpukit/libmisc/monitor/mon-itask.c +++ b/cpukit/libmisc/monitor/mon-itask.c @@ -101,7 +101,7 @@ rtems_monitor_init_task_dump( length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose); length += rtems_monitor_pad(25, length); - length += fprintf(stdout,"%" PRId32 " [0x%" PRIx32 "]", + length += fprintf(stdout,"%" PRId32 " [0x%" PRIx32 "]", monitor_itask->argument, monitor_itask->argument); length += rtems_monitor_pad(39, length); diff --git a/cpukit/libmisc/monitor/mon-network.c b/cpukit/libmisc/monitor/mon-network.c index cf703dafeb..2e3404b8a4 100644 --- a/cpukit/libmisc/monitor/mon-network.c +++ b/cpukit/libmisc/monitor/mon-network.c @@ -50,19 +50,19 @@ void mon_ifconfig(int argc, char *argv[], memset(&dstaddr, 0, sizeof(dstaddr)); memset(&netmask, 0, sizeof(netmask)); memset(&broadcast, 0, sizeof(broadcast)); - + ipaddr.sin_len = sizeof(ipaddr); ipaddr.sin_family = AF_INET; - + dstaddr.sin_len = sizeof(dstaddr); dstaddr.sin_family = AF_INET; - + netmask.sin_len = sizeof(netmask); netmask.sin_family = AF_INET; - + broadcast.sin_len = sizeof(broadcast); broadcast.sin_family = AF_INET; - + cur_idx = 0; if (argc <= 1) { /* display all interfaces */ @@ -81,11 +81,11 @@ void mon_ifconfig(int argc, char *argv[], cur_idx += 2; } } - + if ((f_down !=0) && (f_ip != 0)) { f_up = 1; } - + while(argc > cur_idx) { if (strcmp(argv[cur_idx], "up") == 0) { f_up = 1; @@ -101,7 +101,7 @@ void mon_ifconfig(int argc, char *argv[], if ((cur_idx + 1) >= argc) { printf("No netmask address\n"); return; - } + } if (inet_pton(AF_INET, argv[cur_idx+1], &netmask.sin_addr) < 0) { printf("bad netmask: %s\n", argv[cur_idx]); return; @@ -112,7 +112,7 @@ void mon_ifconfig(int argc, char *argv[], if ((cur_idx + 1) >= argc) { printf("No broadcast address\n"); return; - } + } if (inet_pton(AF_INET, argv[cur_idx+1], &broadcast.sin_addr) < 0) { printf("bad broadcast: %s\n", argv[cur_idx]); return; @@ -123,22 +123,22 @@ void mon_ifconfig(int argc, char *argv[], if ((cur_idx + 1) >= argc) { printf("No pointopoint address\n"); return; - } + } if (inet_pton(AF_INET, argv[cur_idx+1], &dstaddr.sin_addr) < 0) { printf("bad pointopoint: %s\n", argv[cur_idx]); return; } - + f_ptp = 1; cur_idx += 1; } else { printf("Bad parameter: %s\n", argv[cur_idx]); return; } - + cur_idx += 1; } - + printf("ifconfig "); if (iface != NULL) { printf("%s ", iface); @@ -147,25 +147,25 @@ void mon_ifconfig(int argc, char *argv[], inet_ntop(AF_INET, &ipaddr.sin_addr, str, 256); printf("%s ", str); } - + if (f_netmask != 0) { char str[256]; inet_ntop(AF_INET, &netmask.sin_addr, str, 256); printf("netmask %s ", str); } - + if (f_bcast != 0) { char str[256]; inet_ntop(AF_INET, &broadcast.sin_addr, str, 256); printf("broadcast %s ", str); } - + if (f_ptp != 0) { char str[256]; inet_ntop(AF_INET, &dstaddr.sin_addr, str, 256); printf("pointopoint %s ", str); } - + if (f_up != 0) { printf("up\n"); } else if (f_down != 0) { @@ -174,12 +174,12 @@ void mon_ifconfig(int argc, char *argv[], printf("\n"); } } - + if ((iface == NULL) || ((f_ip == 0) && (f_down == 0) && (f_up == 0))) { rtems_bsdnet_show_if_stats(); return; } - + flags = 0; if (f_netmask) { rc = rtems_bsdnet_ifconfig(iface, SIOCSIFNETMASK, &netmask); @@ -188,7 +188,7 @@ void mon_ifconfig(int argc, char *argv[], return; } } - + if (f_bcast) { rc = rtems_bsdnet_ifconfig(iface, SIOCSIFBRDADDR, &broadcast); if (rc < 0) { @@ -196,7 +196,7 @@ void mon_ifconfig(int argc, char *argv[], return; } } - + if (f_ptp) { rc = rtems_bsdnet_ifconfig(iface, SIOCSIFDSTADDR, &dstaddr); if (rc < 0) { @@ -205,8 +205,8 @@ void mon_ifconfig(int argc, char *argv[], } flags |= IFF_POINTOPOINT; } - - /* This must come _after_ setting the netmask, broadcast addresses */ + + /* This must come _after_ setting the netmask, broadcast addresses */ if (f_ip) { rc = rtems_bsdnet_ifconfig(iface, SIOCSIFADDR, &ipaddr); if (rc < 0) { @@ -214,15 +214,15 @@ void mon_ifconfig(int argc, char *argv[], return; } } - + if (f_up != 0) { flags |= IFF_UP; } - + if (f_down != 0) { printf("Warning: taking interfaces down is not supported\n"); } - + rc = rtems_bsdnet_ifconfig(iface, SIOCSIFFLAGS, &flags); if (rc < 0) { printf("Could not set interface flags: %s\n", strerror(errno)); @@ -245,28 +245,28 @@ void mon_route(int argc, char *argv[], int cur_idx; int flags; int rc; - + memset(&dst, 0, sizeof(dst)); memset(&gw, 0, sizeof(gw)); memset(&netmask, 0, sizeof(netmask)); - + dst.sin_len = sizeof(dst); dst.sin_family = AF_INET; - dst.sin_addr.s_addr = inet_addr("0.0.0.0"); - + dst.sin_addr.s_addr = inet_addr("0.0.0.0"); + gw.sin_len = sizeof(gw); gw.sin_family = AF_INET; - gw.sin_addr.s_addr = inet_addr("0.0.0.0"); - + gw.sin_addr.s_addr = inet_addr("0.0.0.0"); + netmask.sin_len = sizeof(netmask); netmask.sin_family = AF_INET; - netmask.sin_addr.s_addr = inet_addr("255.255.255.0"); - + netmask.sin_addr.s_addr = inet_addr("255.255.255.0"); + if (argc < 2) { rtems_bsdnet_show_inet_routes(); return; - } - + } + if (strcmp(argv[1], "add") == 0) { cmd = RTM_ADD; } else if (strcmp(argv[1], "del") == 0) { @@ -276,12 +276,12 @@ void mon_route(int argc, char *argv[], printf("\tit should be 'add' or 'del'\n"); return; } - + if (argc < 3) { printf("not enough arguments\n"); return; } - + if (strcmp(argv[2], "-host") == 0) { f_host = 1; } else if (strcmp(argv[2], "-net") == 0) { @@ -291,14 +291,14 @@ void mon_route(int argc, char *argv[], printf("\tit should be '-host' or '-net'\n"); return; } - + if (argc < 4) { printf("not enough arguments\n"); return; } - + inet_pton(AF_INET, argv[3], &dst.sin_addr); - + cur_idx = 4; while(cur_idx < argc) { if (strcmp(argv[cur_idx], "gw") == 0) { @@ -323,7 +323,7 @@ void mon_route(int argc, char *argv[], } cur_idx += 1; } - + flags = RTF_STATIC; if (f_gw != 0) { flags |= RTF_GATEWAY; diff --git a/cpukit/libmisc/monitor/mon-part.c b/cpukit/libmisc/monitor/mon-part.c index 82ae877299..4bdf3032e0 100644 --- a/cpukit/libmisc/monitor/mon-part.c +++ b/cpukit/libmisc/monitor/mon-part.c @@ -39,7 +39,7 @@ rtems_monitor_part_dump_header( ID NAME ATTR STARTADDR LENGTH BUF_SIZE USED_BLOCKS\n"); /*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234 1 2 3 4 5 6 7 */ - + rtems_monitor_separator(); } diff --git a/cpukit/libmisc/monitor/mon-prmisc.c b/cpukit/libmisc/monitor/mon-prmisc.c index 399d495abc..3f0c224f39 100644 --- a/cpukit/libmisc/monitor/mon-prmisc.c +++ b/cpukit/libmisc/monitor/mon-prmisc.c @@ -97,7 +97,7 @@ rtems_monitor_dump_name(rtems_id id) { char name_buffer[18]; - rtems_object_get_name( id, sizeof(name_buffer), name_buffer ); + rtems_object_get_name( id, sizeof(name_buffer), name_buffer ); return fprintf( stdout, name_buffer ); } diff --git a/cpukit/libmisc/monitor/mon-region.c b/cpukit/libmisc/monitor/mon-region.c index 8881bb21ff..06008214e4 100644 --- a/cpukit/libmisc/monitor/mon-region.c +++ b/cpukit/libmisc/monitor/mon-region.c @@ -40,7 +40,7 @@ rtems_monitor_region_dump_header( ID NAME ATTR STARTADDR LENGTH PAGE_SIZE USED_BLOCKS\n"); /*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234 1 2 3 4 5 6 7 */ - + rtems_monitor_separator(); } diff --git a/cpukit/libmisc/monitor/mon-sema.c b/cpukit/libmisc/monitor/mon-sema.c index 12282ce148..276601c04c 100644 --- a/cpukit/libmisc/monitor/mon-sema.c +++ b/cpukit/libmisc/monitor/mon-sema.c @@ -23,18 +23,18 @@ rtems_monitor_sema_canonical( Semaphore_Control *rtems_sema = (Semaphore_Control *) sema_void; canonical_sema->attribute = rtems_sema->attribute_set; - canonical_sema->priority_ceiling = + canonical_sema->priority_ceiling = rtems_sema->Core_control.mutex.Attributes.priority_ceiling; - canonical_sema->holder_id = + canonical_sema->holder_id = rtems_sema->Core_control.mutex.holder_id; if (_Attributes_Is_counting_semaphore(canonical_sema->attribute)) { /* we have a counting semaphore */ - canonical_sema->cur_count = + canonical_sema->cur_count = rtems_sema->Core_control.semaphore.count; - canonical_sema->max_count = + canonical_sema->max_count = rtems_sema->Core_control.semaphore.Attributes.maximum_count; } else { @@ -54,7 +54,7 @@ rtems_monitor_sema_dump_header( ID NAME ATTR PRICEIL CURR_CNT HOLDID \n"); /*23456789 123456789 123456789 123456789 123456789 123456789 123456789 1234 1 2 3 4 5 6 7 */ - + rtems_monitor_separator(); } diff --git a/cpukit/libmisc/monitor/mon-task.c b/cpukit/libmisc/monitor/mon-task.c index 9378436fef..6007b3f879 100644 --- a/cpukit/libmisc/monitor/mon-task.c +++ b/cpukit/libmisc/monitor/mon-task.c @@ -33,7 +33,7 @@ rtems_monitor_task_canonical( canonical_task->state = rtems_thread->current_state; canonical_task->wait_id = rtems_thread->Wait.id; canonical_task->events = api->pending_events; - /* + /* * FIXME: make this optionally cpu_time_executed */ #if 0 diff --git a/cpukit/libmisc/shell/cmds.c b/cpukit/libmisc/shell/cmds.c index 79bc8c5835..e8d6c581df 100644 --- a/cpukit/libmisc/shell/cmds.c +++ b/cpukit/libmisc/shell/cmds.c @@ -53,7 +53,7 @@ static bool rtems_shell_register_command(const rtems_monitor_command_entry_t *e, if (strcmp("exit", e->command) != 0) { rtems_shell_cmd_t *shell_cmd = (rtems_shell_cmd_t *) malloc(sizeof(rtems_shell_cmd_t)); - + if (shell_cmd != NULL) { shell_cmd->name = e->command; shell_cmd->topic = "monitor"; @@ -61,7 +61,7 @@ static bool rtems_shell_register_command(const rtems_monitor_command_entry_t *e, shell_cmd->command = rtems_shell_main_monitor; shell_cmd->alias = NULL; shell_cmd->next = NULL; - + if (rtems_shell_add_cmd_struct(shell_cmd) == NULL) { free(shell_cmd); } diff --git a/cpukit/libmisc/shell/dd-args.c b/cpukit/libmisc/shell/dd-args.c index 8e592e8005..c932633cde 100644 --- a/cpukit/libmisc/shell/dd-args.c +++ b/cpukit/libmisc/shell/dd-args.c @@ -104,7 +104,7 @@ jcl(rtems_shell_dd_globals* globals, char **argv) char *arg; oper = NULL; - + in.dbsz = out.dbsz = 512; while ((oper = *++argv) != NULL) { @@ -372,7 +372,7 @@ get_num(rtems_shell_dd_globals* globals, const char *val) num = strtouq(val, &expr, 0); if (errno != 0) /* Overflow or underflow. */ err(exit_jump, 1, "%s", oper); - + if (expr == val) /* No valid digits. */ errx(exit_jump, 1, "%s: illegal numeric value", oper); @@ -446,7 +446,7 @@ get_off_t(rtems_shell_dd_globals* globals, const char *val) num = strtoq(val, &expr, 0); if (errno != 0) /* Overflow or underflow. */ err(exit_jump, 1, "%s", oper); - + if (expr == val) /* No valid digits. */ errx(exit_jump, 1, "%s: illegal numeric value", oper); diff --git a/cpukit/libmisc/shell/dd-position.c b/cpukit/libmisc/shell/dd-position.c index bcd9046c15..2c9d147189 100644 --- a/cpukit/libmisc/shell/dd-position.c +++ b/cpukit/libmisc/shell/dd-position.c @@ -129,7 +129,7 @@ pos_out(rtems_shell_dd_globals* globals) off_t cnt; ssize_t n; #endif - + /* * If not a tape, try seeking on the file. Seeking on a pipe is * going to fail, but don't protect the user -- they shouldn't diff --git a/cpukit/libmisc/shell/fts.c b/cpukit/libmisc/shell/fts.c index 37f72ebcfa..1383e07798 100644 --- a/cpukit/libmisc/shell/fts.c +++ b/cpukit/libmisc/shell/fts.c @@ -366,7 +366,7 @@ fts_read( } p->fts_info = FTS_DP; return (p); - } + } /* Rebuild if only read the names and now traversing. */ if (sp->fts_child && ISSET(FTS_NAMEONLY)) { @@ -571,7 +571,7 @@ fts_children( if (instr == FTS_NAMEONLY) { SET(FTS_NAMEONLY); instr = BNAMES; - } else + } else instr = BCHILD; /* @@ -777,7 +777,7 @@ mem1: saved_errno = errno; p->fts_accpath = cur->fts_accpath; } else if (nlinks == 0 #ifdef DT_DIR - || (nostat && + || (nostat && dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN) #endif ) { @@ -899,7 +899,7 @@ fts_stat( if (!lstat(p->fts_accpath, sbp)) { errno = 0; return (FTS_SLNONE); - } + } p->fts_errno = saved_errno; goto err; } @@ -974,7 +974,7 @@ fts_sort( } for (ap = sp->fts_array, p = head; p; p = p->fts_link) *ap++ = p; - qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), + qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), (int (*) __P((const void *, const void *)))sp->fts_compar); for (head = *(ap = sp->fts_array); --nitems; ++ap) ap[0]->fts_link = ap[1]; @@ -1081,7 +1081,7 @@ fts_pow2( * Allow essentially unlimited paths; find, rm, ls should all work on any tree. * Most systems will allow creation of paths much longer than MAXPATHLEN, even * though the kernel won't resolve them. Round up the new size to a power of 2, - * so we don't realloc the path 2 bytes at a time. + * so we don't realloc the path 2 bytes at a time. */ static int fts_palloc( diff --git a/cpukit/libmisc/shell/hexdump-conv.c b/cpukit/libmisc/shell/hexdump-conv.c index 8a3830a6a9..bd827cc7c9 100644 --- a/cpukit/libmisc/shell/hexdump-conv.c +++ b/cpukit/libmisc/shell/hexdump-conv.c @@ -132,7 +132,7 @@ retry: if (!odmode) { *pr->cchar = 'c'; (void)printf(pr->fmt, (int)wc); - } else { + } else { *pr->cchar = 'C'; assert(strcmp(pr->fmt, "%3C") == 0); width = wcwidth(wc); diff --git a/cpukit/libmisc/shell/hexdump-display.c b/cpukit/libmisc/shell/hexdump-display.c index b5886c5b02..9aca5e29db 100644 --- a/cpukit/libmisc/shell/hexdump-display.c +++ b/cpukit/libmisc/shell/hexdump-display.c @@ -276,8 +276,8 @@ get(rtems_shell_hexdump_globals* globals) * XXX bcmp() is not quite right in the presence * of multibyte characters. */ - if (vflag != ALL && - valid_save && + if (vflag != ALL && + valid_save && bcmp(curp, savp, nread) == 0) { if (vflag != DUP) (void)printf("*\n"); diff --git a/cpukit/libmisc/shell/hexdump-odsyntax.c b/cpukit/libmisc/shell/hexdump-odsyntax.c index d80b4cbed9..e95441f789 100644 --- a/cpukit/libmisc/shell/hexdump-odsyntax.c +++ b/cpukit/libmisc/shell/hexdump-odsyntax.c @@ -76,7 +76,7 @@ oldsyntax(rtems_shell_hexdump_globals* globals, int argc, char ***argvp) char **argv, *end; struct getopt_data getopt_reent; - memset(&getopt_reent, 0, sizeof(getopt_data)); + memset(&getopt_reent, 0, sizeof(getopt_data)); /* Add initial (default) address format. -A may change it later. */ #define TYPE_OFFSET 7 diff --git a/cpukit/libmisc/shell/hexsyntax.c b/cpukit/libmisc/shell/hexsyntax.c index 664508bc9e..4d81249b8d 100644 --- a/cpukit/libmisc/shell/hexsyntax.c +++ b/cpukit/libmisc/shell/hexsyntax.c @@ -63,7 +63,7 @@ newsyntax(rtems_shell_hexdump_globals* globals, int argc, char ***argvp) char *p, **argv; struct getopt_data getopt_reent; - memset(&getopt_reent, 0, sizeof(getopt_data)); + memset(&getopt_reent, 0, sizeof(getopt_data)); argv = *argvp; if ((p = rindex(argv[0], 'h')) != NULL && diff --git a/cpukit/libmisc/shell/login_prompt.c b/cpukit/libmisc/shell/login_prompt.c index 46b0aa5e0c..2c04667ee3 100644 --- a/cpukit/libmisc/shell/login_prompt.c +++ b/cpukit/libmisc/shell/login_prompt.c @@ -10,42 +10,42 @@ * Parts of this software was created by * Till Straumann <strauman@slac.stanford.edu>, 2003-2007 * Stanford Linear Accelerator Center, Stanford University. - * - * Acknowledgement of sponsorship - * ------------------------------ - * Parts of this software was produced by + * + * Acknowledgement of sponsorship + * ------------------------------ + * Parts of this software was produced by * the Stanford Linear Accelerator Center, Stanford University, * under Contract DE-AC03-76SFO0515 with the Department of Energy. - * - * Government disclaimer of liability - * ---------------------------------- - * Neither the United States nor the United States Department of Energy, - * nor any of their employees, makes any warranty, express or implied, or - * assumes any legal liability or responsibility for the accuracy, + * + * Government disclaimer of liability + * ---------------------------------- + * Neither the United States nor the United States Department of Energy, + * nor any of their employees, makes any warranty, express or implied, or + * assumes any legal liability or responsibility for the accuracy, * completeness, or usefulness of any data, apparatus, product, or process * disclosed, or represents that its use would not infringe privately owned - * rights. - * - * Stanford disclaimer of liability - * -------------------------------- - * Stanford University makes no representations or warranties, express or - * implied, nor assumes any liability for the use of this software. - * - * Stanford disclaimer of copyright - * -------------------------------- - * Stanford University, owner of the copyright, hereby disclaims its - * copyright and all other rights in this software. Hence, anyone may - * freely use it for any purpose without restriction. - * - * Maintenance of notices - * ---------------------- - * In the interest of clarity regarding the origin and status of this - * SLAC software, this and all the preceding Stanford University notices - * are to remain affixed to any copy or derivative of this software made - * or distributed by the recipient and are to be affixed to any copy of - * software made or distributed by the recipient that contains a copy or - * derivative of this software. - * + * rights. + * + * Stanford disclaimer of liability + * -------------------------------- + * Stanford University makes no representations or warranties, express or + * implied, nor assumes any liability for the use of this software. + * + * Stanford disclaimer of copyright + * -------------------------------- + * Stanford University, owner of the copyright, hereby disclaims its + * copyright and all other rights in this software. Hence, anyone may + * freely use it for any purpose without restriction. + * + * Maintenance of notices + * ---------------------- + * In the interest of clarity regarding the origin and status of this + * SLAC software, this and all the preceding Stanford University notices + * are to remain affixed to any copy or derivative of this software made + * or distributed by the recipient and are to be affixed to any copy of + * software made or distributed by the recipient that contains a copy or + * derivative of this software. + * * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 * * Copyright (c) 2009 embedded brains GmbH and others. diff --git a/cpukit/libmisc/shell/main_blksync.c b/cpukit/libmisc/shell/main_blksync.c index 8226aefc9a..bf8369570e 100644 --- a/cpukit/libmisc/shell/main_blksync.c +++ b/cpukit/libmisc/shell/main_blksync.c @@ -36,7 +36,7 @@ int rtems_shell_main_blksync( const char* driver = NULL; int arg; int fd; - + for (arg = 1; arg < argc; arg++) { if (argv[arg][0] == '-') { fprintf( stderr, "%s: invalid option: %s\n", argv[0], argv[arg]); @@ -51,18 +51,18 @@ int rtems_shell_main_blksync( } } } - + fd = open (driver, O_WRONLY, 0); if (fd < 0) { fprintf( stderr, "%s: driver open failed: %s\n", argv[0], strerror (errno)); return 1; } - + if (ioctl (fd, RTEMS_BLKIO_SYNCDEV) < 0) { fprintf( stderr, "%s: driver sync failed: %s\n", argv[0], strerror (errno)); return 1; } - + close (fd); return 0; } diff --git a/cpukit/libmisc/shell/main_cp.c b/cpukit/libmisc/shell/main_cp.c index b974dab6d3..5b56235abd 100644 --- a/cpukit/libmisc/shell/main_cp.c +++ b/cpukit/libmisc/shell/main_cp.c @@ -53,11 +53,11 @@ __RCSID("$NetBSD: cp.c,v 1.39 2005/10/24 12:59:07 kleink Exp $"); #endif /* * Cp copies source files to target files. - * + * * The global PATH_T structure "to" always contains the path to the * current target file. Since fts(3) does not change directories, * this path can be either absolute or dot-relative. - * + * * The basic algorithm is to initialize "to" and use fts(3) to traverse * the file hierarchy rooted in the argument list. A trivial case is the * case of 'cp file1 file2'. The more interesting case is the case of @@ -129,7 +129,7 @@ main_cp(rtems_shell_cp_globals* cp_globals, int argc, char *argv[]) struct getopt_data getopt_reent; Hflag = Lflag = Pflag = 0; - memset(&getopt_reent, 0, sizeof(getopt_data)); + memset(&getopt_reent, 0, sizeof(getopt_data)); while ((ch = getopt_r(argc, argv, "HLPRafilnprv", &getopt_reent)) != -1) switch (ch) { @@ -208,7 +208,7 @@ main_cp(rtems_shell_cp_globals* cp_globals, int argc, char *argv[]) #if 0 (void)signal(SIGINFO, siginfo); #endif - + /* Save the target base in "to". */ target = argv[--argc]; if (strlcpy(to.p_path, target, sizeof(to.p_path)) >= sizeof(to.p_path)) @@ -446,7 +446,7 @@ copy(rtems_shell_cp_globals* cp_globals, curr->fts_level == 0)) { if (copy_file(cp_globals, curr, dne)) badcp = rval = 1; - } else { + } else { if (copy_link(cp_globals, curr, !dne)) badcp = rval = 1; } @@ -552,4 +552,4 @@ rtems_shell_cmd_t rtems_shell_CP_Command = { NULL, /* alias */ NULL /* next */ }; - + diff --git a/cpukit/libmisc/shell/main_date.c b/cpukit/libmisc/shell/main_date.c index 4ddbc118b8..c91b938419 100644 --- a/cpukit/libmisc/shell/main_date.c +++ b/cpukit/libmisc/shell/main_date.c @@ -54,7 +54,7 @@ int rtems_shell_main_date( sprintf( buf, "%s %s", argv[1], argv[2] ); result = strptime( - buf, + buf, "%Y-%m-%d %T", &TOD ); diff --git a/cpukit/libmisc/shell/main_dd.c b/cpukit/libmisc/shell/main_dd.c index 98d69811f9..7fa2435522 100644 --- a/cpukit/libmisc/shell/main_dd.c +++ b/cpukit/libmisc/shell/main_dd.c @@ -158,7 +158,7 @@ parity(u_char c) { int i; - i = c ^ (c >> 1) ^ (c >> 2) ^ (c >> 3) ^ + i = c ^ (c >> 1) ^ (c >> 2) ^ (c >> 3) ^ (c >> 4) ^ (c >> 5) ^ (c >> 6) ^ (c >> 7); return (i & 1); } @@ -285,7 +285,7 @@ setup(rtems_shell_dd_globals* globals) } (void)gettimeofday(&tv, (struct timezone *)NULL); - st.start = tv.tv_sec + tv.tv_usec * 1e-6; + st.start = tv.tv_sec + tv.tv_usec * 1e-6; } static void @@ -301,7 +301,7 @@ getfdtype(rtems_shell_dd_globals* globals, IO *io) if (S_ISREG(sb.st_mode)) io->flags |= ISTRUNC; #if RTEMS_REMOVED - if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { + if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) { if (ioctl(io->fd, FIODTYPE, &type) == -1) { err(exit_jump, 1, "%s", io->name); } else { diff --git a/cpukit/libmisc/shell/main_getenv.c b/cpukit/libmisc/shell/main_getenv.c index d18c301ee3..4e4789b632 100644 --- a/cpukit/libmisc/shell/main_getenv.c +++ b/cpukit/libmisc/shell/main_getenv.c @@ -35,7 +35,7 @@ int rtems_shell_main_getenv(int argc, char *argv[]) } printf ("%s\n", string); - + return 0; } diff --git a/cpukit/libmisc/shell/main_hexdump.c b/cpukit/libmisc/shell/main_hexdump.c index 87656102fe..ec319e104a 100644 --- a/cpukit/libmisc/shell/main_hexdump.c +++ b/cpukit/libmisc/shell/main_hexdump.c @@ -127,7 +127,7 @@ main_hexdump(rtems_shell_hexdump_globals* globals, int argc, char *argv[]) #if RTEMS_REMOVED (void)setlocale(LC_ALL, ""); #endif - + if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od")) newsyntax(globals, argc, &argv); else @@ -158,4 +158,4 @@ rtems_shell_cmd_t rtems_shell_HEXDUMP_Command = { NULL, /* alias */ NULL /* next */ }; - + diff --git a/cpukit/libmisc/shell/main_ifconfig.c b/cpukit/libmisc/shell/main_ifconfig.c index 20870fc318..5326710918 100644 --- a/cpukit/libmisc/shell/main_ifconfig.c +++ b/cpukit/libmisc/shell/main_ifconfig.c @@ -53,19 +53,19 @@ int rtems_shell_main_ifconfig( memset(&dstaddr, 0, sizeof(dstaddr)); memset(&netmask, 0, sizeof(netmask)); memset(&broadcast, 0, sizeof(broadcast)); - + ipaddr.sin_len = sizeof(ipaddr); ipaddr.sin_family = AF_INET; - + dstaddr.sin_len = sizeof(dstaddr); dstaddr.sin_family = AF_INET; - + netmask.sin_len = sizeof(netmask); netmask.sin_family = AF_INET; - + broadcast.sin_len = sizeof(broadcast); broadcast.sin_family = AF_INET; - + cur_idx = 0; if (argc <= 1) { /* display all interfaces */ @@ -84,11 +84,11 @@ int rtems_shell_main_ifconfig( cur_idx += 2; } } - + if ((f_down !=0) && (f_ip != 0)) { f_up = 1; } - + while(argc > cur_idx) { if (strcmp(argv[cur_idx], "up") == 0) { f_up = 1; @@ -104,7 +104,7 @@ int rtems_shell_main_ifconfig( if ((cur_idx + 1) >= argc) { printf("No netmask address\n"); return -1; - } + } if (inet_pton(AF_INET, argv[cur_idx+1], &netmask.sin_addr) < 0) { printf("bad netmask: %s\n", argv[cur_idx]); return -1; @@ -115,7 +115,7 @@ int rtems_shell_main_ifconfig( if ((cur_idx + 1) >= argc) { printf("No broadcast address\n"); return -1; - } + } if (inet_pton(AF_INET, argv[cur_idx+1], &broadcast.sin_addr) < 0) { printf("bad broadcast: %s\n", argv[cur_idx]); return -1; @@ -126,7 +126,7 @@ int rtems_shell_main_ifconfig( if ((cur_idx + 1) >= argc) { printf("No pointopoint address\n"); return -1; - } + } if (inet_pton(AF_INET, argv[cur_idx+1], &dstaddr.sin_addr) < 0) { printf("bad pointopoint: %s\n", argv[cur_idx]); return -1; @@ -139,7 +139,7 @@ int rtems_shell_main_ifconfig( } cur_idx += 1; } - + printf("ifconfig "); if (iface != NULL) { printf("%s ", iface); @@ -148,25 +148,25 @@ int rtems_shell_main_ifconfig( inet_ntop(AF_INET, &ipaddr.sin_addr, str, 256); printf("%s ", str); } - + if (f_netmask != 0) { char str[256]; inet_ntop(AF_INET, &netmask.sin_addr, str, 256); printf("netmask %s ", str); } - + if (f_bcast != 0) { char str[256]; inet_ntop(AF_INET, &broadcast.sin_addr, str, 256); printf("broadcast %s ", str); } - + if (f_ptp != 0) { char str[256]; inet_ntop(AF_INET, &dstaddr.sin_addr, str, 256); printf("pointopoint %s ", str); } - + if (f_up != 0) { printf("up\n"); } else if (f_down != 0) { @@ -175,12 +175,12 @@ int rtems_shell_main_ifconfig( printf("\n"); } } - + if ((iface == NULL) || ((f_ip == 0) && (f_down == 0) && (f_up == 0))) { rtems_bsdnet_show_if_stats(); return 0; } - + flags = 0; if (f_netmask) { rc = rtems_bsdnet_ifconfig(iface, SIOCSIFNETMASK, &netmask); @@ -189,7 +189,7 @@ int rtems_shell_main_ifconfig( return -1; } } - + if (f_bcast) { rc = rtems_bsdnet_ifconfig(iface, SIOCSIFBRDADDR, &broadcast); if (rc < 0) { @@ -197,7 +197,7 @@ int rtems_shell_main_ifconfig( return -1; } } - + if (f_ptp) { rc = rtems_bsdnet_ifconfig(iface, SIOCSIFDSTADDR, &dstaddr); if (rc < 0) { @@ -206,8 +206,8 @@ int rtems_shell_main_ifconfig( } flags |= IFF_POINTOPOINT; } - - /* This must come _after_ setting the netmask, broadcast addresses */ + + /* This must come _after_ setting the netmask, broadcast addresses */ if (f_ip) { rc = rtems_bsdnet_ifconfig(iface, SIOCSIFADDR, &ipaddr); if (rc < 0) { @@ -215,15 +215,15 @@ int rtems_shell_main_ifconfig( return -1; } } - + if (f_up != 0) { flags |= IFF_UP; } - + if (f_down != 0) { printf("Warning: taking interfaces down is not supported\n"); } - + rc = rtems_bsdnet_ifconfig(iface, SIOCSIFFLAGS, &flags); if (rc < 0) { printf("Could not set interface flags: %s\n", strerror(errno)); diff --git a/cpukit/libmisc/shell/main_ln.c b/cpukit/libmisc/shell/main_ln.c index 871aa9551b..cfe629b234 100644 --- a/cpukit/libmisc/shell/main_ln.c +++ b/cpukit/libmisc/shell/main_ln.c @@ -141,7 +141,7 @@ main_ln(rtems_shell_ln_globals* globals, int argc, char *argv[]) setprogname(argv[0]); (void)setlocale(LC_ALL, ""); #endif - + while ((ch = getopt_r(argc, argv, "fhinsv", &getopt_reent)) != -1) switch (ch) { case 'f': @@ -159,7 +159,7 @@ main_ln(rtems_shell_ln_globals* globals, int argc, char *argv[]) case 's': sflag = 1; break; - case 'v': + case 'v': vflag = 1; break; case '?': diff --git a/cpukit/libmisc/shell/main_ls.c b/cpukit/libmisc/shell/main_ls.c index 322640b3fd..ace56411de 100644 --- a/cpukit/libmisc/shell/main_ls.c +++ b/cpukit/libmisc/shell/main_ls.c @@ -158,7 +158,7 @@ main_ls(rtems_shell_ls_globals* globals, int argc, char *argv[]) struct getopt_data getopt_reent; memset(&getopt_reent, 0, sizeof(getopt_data)); - + #if RTEMS_REMOVED setprogname(argv[0]); #endif @@ -452,7 +452,7 @@ traverse(rtems_shell_ls_globals* globals, int argc, char *argv[], int options) fts_close(ftsp); return; } - + /* * If not recursing down this tree and don't need stat info, just get * the names. @@ -701,7 +701,7 @@ mastercmp_no_listdir(const FTSENT **a, const FTSENT **b) { int a_info, b_info; int l_f_listdir = 0; - + a_info = (*a)->fts_info; if (a_info == FTS_ERR) return (0); diff --git a/cpukit/libmisc/shell/main_mdump.c b/cpukit/libmisc/shell/main_mdump.c index 297ab6db0e..d196711363 100644 --- a/cpukit/libmisc/shell/main_mdump.c +++ b/cpukit/libmisc/shell/main_mdump.c @@ -52,7 +52,7 @@ int rtems_shell_main_mdump( return -1; } if (max <= 0) { - max = 1; /* print 1 item if 0 or neg. */ + max = 1; /* print 1 item if 0 or neg. */ res = 0; } else { max--; diff --git a/cpukit/libmisc/shell/main_mount.c b/cpukit/libmisc/shell/main_mount.c index 89fafa5e12..0fe569cc5b 100644 --- a/cpukit/libmisc/shell/main_mount.c +++ b/cpukit/libmisc/shell/main_mount.c @@ -62,13 +62,13 @@ int rtems_shell_libc_mounter( /* * Mount the disk. */ - + if (mount (&mt_entry, fs->fs_ops, options, (char*) driver, (char*) path) < 0) { fprintf (stderr, "mount: mount failed: %s\n", strerror (errno)); return 1; } - + return 0; } @@ -86,7 +86,7 @@ int rtems_shell_main_mount( int arg; rtems_shell_mount_fsys_init(); - + for (arg = 1; arg < argc; arg++) { if (argv[arg][0] == '-') { if (argv[arg][1] == 't') { @@ -159,26 +159,26 @@ int rtems_shell_main_mount( fprintf (stderr, "mount: no file-system; see the -L option\n"); return 1; } - + if (fs->driver_needed && !driver) { fprintf (stderr, "mount: no driver\n"); return 1; } - + if (!mount_point) { fprintf (stderr, "mount: no mount point\n"); return 1; } - + /* * Mount the disk. */ - + if (fs->mounter (driver, mount_point, fs, options)) return 1; printf ("mounted %s -> %s\n", driver, mount_point); - + return 0; } diff --git a/cpukit/libmisc/shell/main_mount_nfs.c b/cpukit/libmisc/shell/main_mount_nfs.c index b89dd16abe..121d0ca6c2 100644 --- a/cpukit/libmisc/shell/main_mount_nfs.c +++ b/cpukit/libmisc/shell/main_mount_nfs.c @@ -49,12 +49,12 @@ rtems_shell_nfs_mounter ( } nfsInit (0, 0); - + uidhost = strdup (device); path = strchr (uidhost, ':'); *path = '\0'; path++; - + ret = nfsMount(uidhost, path, (char*) mntpoint); free (uidhost); diff --git a/cpukit/libmisc/shell/main_msdosfmt.c b/cpukit/libmisc/shell/main_msdosfmt.c index 493ae25799..2f0e7f2c63 100644 --- a/cpukit/libmisc/shell/main_msdosfmt.c +++ b/cpukit/libmisc/shell/main_msdosfmt.c @@ -40,11 +40,11 @@ int rtems_shell_main_msdos_format( cluster_align: 0, info_level: 0 }; - + unsigned long tmp; const char* driver = NULL; int arg; - + for (arg = 1; arg < argc; arg++) { if (argv[arg][0] == '-') { switch (argv[arg][1]) { @@ -74,7 +74,7 @@ int rtems_shell_main_msdos_format( rqdata.sectors_per_cluster = (uint32_t) tmp; break; - + case 'r': arg++; if (arg == argc) { @@ -92,7 +92,7 @@ int rtems_shell_main_msdos_format( rqdata.files_per_root_dir = (uint32_t) tmp; break; - + case 't': arg++; if (arg == argc) { @@ -117,11 +117,11 @@ int rtems_shell_main_msdos_format( case 'v': rqdata.info_level++; break; - + default: fprintf (stderr, "error: invalid option: %s\n", argv[arg]); return 1; - + } } else { if (!driver) @@ -137,7 +137,7 @@ int rtems_shell_main_msdos_format( fprintf (stderr, "error: no driver\n"); return 1; } - + printf ("msdos format: %s\n", driver); if (rqdata.info_level) @@ -152,7 +152,7 @@ int rtems_shell_main_msdos_format( printf (" %-20s: %d\n", "quick_format", rqdata.quick_format); printf (" %-20s: %lu\n", "cluster align", rqdata.cluster_align); } - + if (msdos_format (driver, &rqdata) < 0) { fprintf (stderr, "error: format failed: %s\n", strerror (errno)); return 1; diff --git a/cpukit/libmisc/shell/main_mv.c b/cpukit/libmisc/shell/main_mv.c index 04cc8a33ee..644900bc17 100644 --- a/cpukit/libmisc/shell/main_mv.c +++ b/cpukit/libmisc/shell/main_mv.c @@ -128,8 +128,8 @@ rtems_shell_main_mv(int argc, char *argv[]) } #define do_move(a1, a2) do_move_mv(globals, a1, a2) -#define fastcopy(a1, a2, a3) fastcopy_mv(globals, a1, a2, a3) -#define copy(a1, a2) copy_mv(globals, a1, a2) +#define fastcopy(a1, a2, a3) fastcopy_mv(globals, a1, a2, a3) +#define copy(a1, a2) copy_mv(globals, a1, a2) #define usage() usage_mv(globals) static int do_move_mv(rtems_shell_mv_globals* globals, char *from, char *to); @@ -151,9 +151,9 @@ main_mv(rtems_shell_mv_globals* globals, int argc, char *argv[]) struct getopt_data getopt_reent; memset(&getopt_reent, 0, sizeof(getopt_data)); - + /* setprogname(argv[0]); */ - + (void)setlocale(LC_ALL, ""); while ((ch = getopt_r(argc, argv, "ifv", &getopt_reent)) != -1) @@ -331,7 +331,7 @@ fastcopy_mv(rtems_shell_mv_globals* globals, char *from, char *to, struct stat * int nread, from_fd, to_fd; blen = 0; - + if ((from_fd = open(from, O_RDONLY, 0)) < 0) { warn("%s", from); return (1); @@ -363,7 +363,7 @@ err: if (unlink(to)) (void)close(to_fd); return (1); } - + (void)free(bp); (void)close(from_fd); #ifdef xBSD4_4 diff --git a/cpukit/libmisc/shell/main_mwdump.c b/cpukit/libmisc/shell/main_mwdump.c index 9520f1e773..f3e3cfc27b 100644 --- a/cpukit/libmisc/shell/main_mwdump.c +++ b/cpukit/libmisc/shell/main_mwdump.c @@ -52,7 +52,7 @@ int rtems_shell_main_mwdump( } if (max <= 0) { - max = 1; /* print 1 item if 0 or neg. */ + max = 1; /* print 1 item if 0 or neg. */ res = 0; } else { max--; diff --git a/cpukit/libmisc/shell/main_netstats.c b/cpukit/libmisc/shell/main_netstats.c index d17696c74e..cc9b95a52c 100644 --- a/cpukit/libmisc/shell/main_netstats.c +++ b/cpukit/libmisc/shell/main_netstats.c @@ -56,7 +56,7 @@ int rtems_shell_main_netstats( /* command */ int verbose = 0; struct getopt_data getopt_reent; - memset(&getopt_reent, 0, sizeof(getopt_data)); + memset(&getopt_reent, 0, sizeof(getopt_data)); while ( (option = getopt_r( argc, argv, "Aimfpcutv", &getopt_reent)) != -1 ) { switch ((char)option) { @@ -75,7 +75,7 @@ int rtems_shell_main_netstats( /* command */ return -1; } } - + if ( verbose ) { printf( "doAll=%d\n" diff --git a/cpukit/libmisc/shell/main_rm.c b/cpukit/libmisc/shell/main_rm.c index 26b6b046f6..d11142dc7f 100644 --- a/cpukit/libmisc/shell/main_rm.c +++ b/cpukit/libmisc/shell/main_rm.c @@ -145,10 +145,10 @@ main_rm(rtems_shell_rm_globals* globals, int argc, char *argv[]) { int ch; char *p; - + struct getopt_data getopt_reent; memset(&getopt_reent, 0, sizeof(getopt_data)); - + /* * Test for the special case where the utility is called as * "unlink", for which the functionality provided is greatly diff --git a/cpukit/libmisc/shell/main_route.c b/cpukit/libmisc/shell/main_route.c index f10b2509d4..ea503b4ef2 100644 --- a/cpukit/libmisc/shell/main_route.c +++ b/cpukit/libmisc/shell/main_route.c @@ -41,28 +41,28 @@ int rtems_shell_main_route( int cur_idx; int flags; int rc; - + memset(&dst, 0, sizeof(dst)); memset(&gw, 0, sizeof(gw)); memset(&netmask, 0, sizeof(netmask)); - + dst.sin_len = sizeof(dst); dst.sin_family = AF_INET; - dst.sin_addr.s_addr = inet_addr("0.0.0.0"); - + dst.sin_addr.s_addr = inet_addr("0.0.0.0"); + gw.sin_len = sizeof(gw); gw.sin_family = AF_INET; - gw.sin_addr.s_addr = inet_addr("0.0.0.0"); - + gw.sin_addr.s_addr = inet_addr("0.0.0.0"); + netmask.sin_len = sizeof(netmask); netmask.sin_family = AF_INET; - netmask.sin_addr.s_addr = inet_addr("255.255.255.0"); - + netmask.sin_addr.s_addr = inet_addr("255.255.255.0"); + if (argc < 2) { rtems_bsdnet_show_inet_routes(); return 0; - } - + } + if (strcmp(argv[1], "add") == 0) { cmd = RTM_ADD; } else if (strcmp(argv[1], "del") == 0) { @@ -72,12 +72,12 @@ int rtems_shell_main_route( printf("\tit should be 'add' or 'del'\n"); return -1; } - + if (argc < 3) { printf("not enough arguments\n"); return -1; } - + if (strcmp(argv[2], "-host") == 0) { f_host = 1; } else if (strcmp(argv[2], "-net") == 0) { @@ -87,14 +87,14 @@ int rtems_shell_main_route( printf("\tit should be '-host' or '-net'\n"); return -1; } - + if (argc < 4) { printf("not enough arguments\n"); return -1; } - + inet_pton(AF_INET, argv[3], &dst.sin_addr); - + cur_idx = 4; while(cur_idx < argc) { if (strcmp(argv[cur_idx], "gw") == 0) { @@ -119,7 +119,7 @@ int rtems_shell_main_route( } cur_idx += 1; } - + flags = RTF_STATIC; if (f_gw != 0) { flags |= RTF_GATEWAY; diff --git a/cpukit/libmisc/shell/main_setenv.c b/cpukit/libmisc/shell/main_setenv.c index 7164c27f9a..a682f19394 100644 --- a/cpukit/libmisc/shell/main_setenv.c +++ b/cpukit/libmisc/shell/main_setenv.c @@ -31,20 +31,20 @@ int rtems_shell_main_setenv(int argc, char *argv[]) } env = argv[1]; - + for (arg = 2; arg < argc; arg++) len += strlen (argv[arg]); len += argc - 2 - 1; string = malloc (len + 1); - + if (!string) { printf ("error: no memory\n"); return 1; } - + for (arg = 2, p = string; arg < argc; arg++) { strcpy (p, argv[arg]); @@ -55,7 +55,7 @@ int rtems_shell_main_setenv(int argc, char *argv[]) p++; } } - + if (setenv (env, string, 1) < 0) { printf ("error: %s\n", strerror (errno)); diff --git a/cpukit/libmisc/shell/main_time.c b/cpukit/libmisc/shell/main_time.c index 0e433484a9..7d6cf557ee 100644 --- a/cpukit/libmisc/shell/main_time.c +++ b/cpukit/libmisc/shell/main_time.c @@ -42,7 +42,7 @@ int rtems_shell_main_time( sc = rtems_clock_get_uptime(&start); if (sc != RTEMS_SUCCESSFUL) printf("error: cannot read time\n"); - + if (argc) { shell_cmd = rtems_shell_lookup_cmd(argv[1]); if ( argv[1] == NULL ) { @@ -65,12 +65,12 @@ int rtems_shell_main_time( --period.tv_sec; period.tv_nsec += 1000000000UL; } - + printf("time: %li:%02li:%02li.%03li\n", period.tv_sec / 3600, period.tv_sec / 60, period.tv_sec % 60, period.tv_nsec / 1000000); - + return errorlevel; } diff --git a/cpukit/libmisc/shell/main_unmount.c b/cpukit/libmisc/shell/main_unmount.c index 0a9de416fe..ba101dc014 100644 --- a/cpukit/libmisc/shell/main_unmount.c +++ b/cpukit/libmisc/shell/main_unmount.c @@ -34,7 +34,7 @@ int rtems_shell_main_unmount( { char* mount_point = NULL; int arg; - + for (arg = 1; arg < argc; arg++) { if (!mount_point) mount_point = argv[arg]; @@ -48,19 +48,19 @@ int rtems_shell_main_unmount( fprintf (stderr, "error: no mount point\n"); return 1; } - + /* * Unmount the disk. */ - + if (unmount (mount_point) < 0) { fprintf (stderr, "error: unmount failed: %s: %s\n", mount_point, strerror (errno)); return 1; } - + printf ("unmounted %s\n", mount_point); - + return 0; } diff --git a/cpukit/libmisc/shell/main_unsetenv.c b/cpukit/libmisc/shell/main_unsetenv.c index 91d9dac7a4..8805ba4341 100644 --- a/cpukit/libmisc/shell/main_unsetenv.c +++ b/cpukit/libmisc/shell/main_unsetenv.c @@ -29,7 +29,7 @@ int rtems_shell_main_unsetenv(int argc, char *argv[]) printf ("error: %s\n", strerror (errno)); return 1; } - + return 0; } diff --git a/cpukit/libmisc/shell/print-ls.c b/cpukit/libmisc/shell/print-ls.c index b0b0b3a385..dc449f558f 100644 --- a/cpukit/libmisc/shell/print-ls.c +++ b/cpukit/libmisc/shell/print-ls.c @@ -343,7 +343,7 @@ printstream(rtems_shell_ls_globals* globals, DISPLAY *dp) if (f_size) { if (f_humanize) extwidth += dp->s_size + 1; - else + else extwidth += dp->s_block + 1; } if (f_type) diff --git a/cpukit/libmisc/shell/shell_cmdset.c b/cpukit/libmisc/shell/shell_cmdset.c index 8f6aa4fdbf..2abaed9242 100644 --- a/cpukit/libmisc/shell/shell_cmdset.c +++ b/cpukit/libmisc/shell/shell_cmdset.c @@ -41,7 +41,7 @@ * Help list the topics * help [topic] list the commands for the topic * help [command] help for the command - * + * */ rtems_shell_cmd_t * rtems_shell_first_cmd; @@ -111,7 +111,7 @@ rtems_shell_cmd_t *rtems_shell_add_cmd_struct( ) { rtems_shell_cmd_t *shell_pvt; - + shell_pvt = rtems_shell_first_cmd; while (shell_pvt) { if (strcmp(shell_pvt->name, shell_cmd->name) == 0) @@ -126,13 +126,13 @@ rtems_shell_cmd_t *rtems_shell_add_cmd_struct( while (shell_pvt->next) shell_pvt = shell_pvt->next; shell_pvt->next = shell_cmd; - } + } rtems_shell_add_topic( shell_cmd->topic ); return shell_cmd; } /* - * Add a command as a set of arguments to the set and + * Add a command as a set of arguments to the set and * allocate the command structure on the fly. */ rtems_shell_cmd_t * rtems_shell_add_cmd( diff --git a/cpukit/libmisc/shell/shell_getprompt.c b/cpukit/libmisc/shell/shell_getprompt.c index 5a445a0168..08c628b219 100644 --- a/cpukit/libmisc/shell/shell_getprompt.c +++ b/cpukit/libmisc/shell/shell_getprompt.c @@ -1,5 +1,5 @@ /* - * Dynamically build the shell prompt + * Dynamically build the shell prompt * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -38,7 +38,7 @@ void rtems_shell_get_prompt( ) { char curdir[256]; - + /* XXX: show_prompt user adjustable */ getcwd(curdir,sizeof(curdir)); snprintf(prompt, size - 1, "%s%s[%s] %c ", diff --git a/cpukit/libmisc/shell/shell_makeargs.c b/cpukit/libmisc/shell/shell_makeargs.c index 35d1cf475d..77d937e101 100644 --- a/cpukit/libmisc/shell/shell_makeargs.c +++ b/cpukit/libmisc/shell/shell_makeargs.c @@ -19,15 +19,15 @@ int rtems_shell_make_args( char *commandLine, - int *argc_p, - char **argv_p, + int *argc_p, + char **argv_p, int max_args ) { int argc; char *command; int status = 0; - + argc = 0; command = commandLine; diff --git a/cpukit/libmisc/shell/shell_script.c b/cpukit/libmisc/shell/shell_script.c index 95b5abb934..9b7587dd1c 100644 --- a/cpukit/libmisc/shell/shell_script.c +++ b/cpukit/libmisc/shell/shell_script.c @@ -69,7 +69,7 @@ static int findOnPATH( strcat( scriptFile, "/" ); strcat( scriptFile, - ( (userScriptName[0] == '.' && userScriptName[1] == '/') ? + ( (userScriptName[0] == '.' && userScriptName[1] == '/') ? &userScriptName[2] : userScriptName) ); } @@ -82,7 +82,7 @@ static int findOnPATH( return 0; #if 0 - /* + /* * Does the command (argv[0]) contain a path ?, i.e. starts with * '.' or contains a '/'? */ @@ -120,7 +120,7 @@ int rtems_shell_main_joel( char scriptFile[PATH_MAX]; struct getopt_data getopt_reent; - memset(&getopt_reent, 0, sizeof(getopt_data)); + memset(&getopt_reent, 0, sizeof(getopt_data)); while ( (option = getopt_r( argc, argv, "o:p:s:t:v", &getopt_reent)) != -1 ) { switch ((char)option) { case 'o': @@ -149,10 +149,10 @@ int rtems_shell_main_joel( case 't': taskName = getopt_reent.optarg; break; - case 'v': + case 'v': verbose = 1; break; - case '?': + case '?': default: rtems_shell_joel_usage(); return -1; @@ -160,7 +160,7 @@ int rtems_shell_main_joel( } if ( verbose ) { - fprintf( stderr, + fprintf( stderr, "outputFile: %s\n" "taskPriority: %" PRId32 "\n" "stackSize: %" PRId32 "\n" @@ -179,10 +179,10 @@ int rtems_shell_main_joel( if ( getopt_reent.optind >= argc ) { fprintf( stderr, "Shell: No script to execute\n" ); return -1; - } - + } + /* - * Find script on the path. + * Find script on the path. * * NOTE: It is terrible that this is done twice but it * seems to be the most expedient thing. @@ -217,7 +217,7 @@ int rtems_shell_main_joel( return -1; return 0; } - + rtems_shell_cmd_t rtems_shell_JOEL_Command = { "joel", /* name */ "joel [args] SCRIPT", /* usage */ @@ -303,7 +303,7 @@ int rtems_shell_script_file( scriptHead[length - 1] = '\0'; /* fprintf( stderr, "FIRST LINE: -%s-\n", scriptHead ); */ - + /* * Verify the name of the "shell" is joel. This means * the line starts with "#! joel". diff --git a/cpukit/libmisc/shell/utils-cp.c b/cpukit/libmisc/shell/utils-cp.c index 6ce71aa599..7b7c7fc771 100644 --- a/cpukit/libmisc/shell/utils-cp.c +++ b/cpukit/libmisc/shell/utils-cp.c @@ -135,7 +135,7 @@ copy_file(rtems_shell_cp_globals* cp_globals __attribute__((unused)), FTSENT *en (void)free(buf); return (0); } else if (iflag) { - (void)fprintf(stderr, "overwrite %s? %s", + (void)fprintf(stderr, "overwrite %s? %s", to.p_path, YESNO); checkch = ch = getchar(); while (ch != '\n' && ch != EOF) @@ -147,9 +147,9 @@ copy_file(rtems_shell_cp_globals* cp_globals __attribute__((unused)), FTSENT *en return (1); } } - + if (fflag) { - /* remove existing destination file name, + /* remove existing destination file name, * create a new file */ (void)unlink(to.p_path); if (!lflag) @@ -255,7 +255,7 @@ copy_file(rtems_shell_cp_globals* cp_globals __attribute__((unused)), FTSENT *en } } (void)close(from_fd); - + /* * Don't remove the target even after an error. The target might * not be a regular file, or its attributes might be important, @@ -401,7 +401,7 @@ setfile(rtems_shell_cp_globals* cp_globals, struct stat *fs, int fd) rval = 1; } #endif - + return (rval); } diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c index a51961c073..702707dc07 100644 --- a/cpukit/libmisc/stackchk/check.c +++ b/cpukit/libmisc/stackchk/check.c @@ -153,7 +153,7 @@ void Stack_check_Initialize( void ) p[2] = 0xDEADF00D; /* DEAD FOOD GOOD DOG */ p[3] = 0x600D0D06; } - + /* * If appropriate, setup the interrupt stack for high water testing * also. @@ -441,7 +441,7 @@ void Stack_check_Dump_threads_usage( } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); } - + } @@ -474,7 +474,7 @@ void rtems_stack_checker_report_usage_with_plugin( print_handler = print; (*print)( context, "Stack usage by thread\n"); - (*print)( context, + (*print)( context, " ID NAME LOW HIGH CURRENT AVAILABLE USED\n" ); diff --git a/cpukit/libmisc/uuid/gen_uuid.c b/cpukit/libmisc/uuid/gen_uuid.c index 1d0aac7ec6..7993ee5332 100644 --- a/cpukit/libmisc/uuid/gen_uuid.c +++ b/cpukit/libmisc/uuid/gen_uuid.c @@ -403,7 +403,7 @@ try_again: if (state_fd > 0) { rewind(state_f); - len = fprintf(state_f, + len = fprintf(state_f, "clock: %04x tv: %016lu %08lu adj: %08d\n", clock_seq, last.tv_sec, last.tv_usec, adjustment); fflush(state_f); |