Skip to content

Commit

Permalink
Use PROCESS_NAME_STRING macro to handle NO_PROCESS_NAMES
Browse files Browse the repository at this point in the history
  • Loading branch information
dak664 committed Aug 3, 2011
1 parent 6ec85fe commit 44f4ee9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion apps/process-list/process-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ update_processwindow(void)
CTK_WIDGET_ADD(&processwindow, &processidlabels[i]);

CTK_LABEL_NEW(&processnamelabels[i],
4, i + 1, 22, 1, (char *)p->name);
4, i + 1, 22, 1, PROCESS_NAME_STRING(p));
CTK_WIDGET_ADD(&processwindow, &processnamelabels[i]);

++i;
Expand Down
2 changes: 1 addition & 1 deletion apps/shell/shell-ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROCESS_THREAD(shell_ps_process, ev, data)

shell_output_str(&ps_command, "Processes:", "");
for(p = PROCESS_LIST(); p != NULL; p = p->next) {
shell_output_str(&ps_command, (char *)p->name, "");
shell_output_str(&ps_command, PROCESS_NAME_STRING(p), "");
}

PROCESS_END();
Expand Down
11 changes: 4 additions & 7 deletions apps/webserver-nano/httpd-cgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,16 +359,13 @@ make_processes(void *p)
{
static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n";
char name[40],tstate[20];
#if PROCESS_CONF_NO_PROCESS_NAMES
strcpy(name, "Not Available");
#else
strncpy(name, ((struct process *)p)->name, 40);
#endif

strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40);
httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]);
return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name,
// *((char **)&(((struct process *)p)->thread)),
*(char **)(&(((struct process *)p)->thread)), //minimal net
// *((char **) &(((struct process *)p)->thread)),
* (char **)(&(((struct process *)p)->thread)), //minimal net
tstate);
}
/*---------------------------------------------------------------------------*/
Expand Down
4 changes: 2 additions & 2 deletions apps/webserver/httpd-cgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ static unsigned short
make_processes(void *p)
{
char name[40];

strncpy(name, ((struct process *)p)->name, 40);
strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40);

return snprintf((char *)uip_appdata, uip_mss(),
Expand Down
3 changes: 2 additions & 1 deletion core/loader/dlloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ dlloader_load(char *path, char *arg)
}

/* Start the process. */
printf("Starting '%s'\n", (*p)->name);

printf("Starting '%s'\n", PROCESS_NAME_STRING(*p));
process_start(*p, arg);

return LOADER_OK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ make_processes(void *p)
static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n";
char name[40],tstate[20];

strncpy(name, ((struct process *)p)->name, 40);
strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40);
httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]);
return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name,
Expand Down
2 changes: 1 addition & 1 deletion platform/avr-raven/apps/raven-webserver/httpd-cgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ make_processes(void *p)
static const char httpd_cgi_proc[] HTTPD_STRING_ATTR = "<tr align=\"center\"><td>%p</td><td>%s</td><td>%p</td><td>%s</td></tr>\r\n";
char name[40],tstate[20];

strncpy(name, ((struct process *)p)->name, 40);
strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40);
httpd_strcpy(tstate,states[9 + ((struct process *)p)->state]);
return httpd_snprintf((char *)uip_appdata, uip_mss(), httpd_cgi_proc, p, name,
Expand Down
2 changes: 1 addition & 1 deletion platform/pc-6001/apps/webserver-mini/httpd-cgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ make_processes(void *p)
{
char name[40];

strncpy(name, ((struct process *)p)->name, 40);
strncpy(name, PROCESS_NAME_STRING((struct process *)p), 40);
petsciiconv_toascii(name, 40);

return sprintf((char *)uip_appdata,
Expand Down

0 comments on commit 44f4ee9

Please sign in to comment.