Changes in uspace/app/redir/redir.c [49647be:d9fae235] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/redir/redir.c
r49647be rd9fae235 39 39 #include <fcntl.h> 40 40 #include <unistd.h> 41 #include <str ing.h>41 #include <str.h> 42 42 #include <stdio.h> 43 43 #include <task.h> 44 #include <str_error.h> 45 46 #define NAME "redir" 44 47 45 48 static void usage(void) 46 49 { 47 printf("Usage: redir [-i <stdin>] [-o <stdout>] [-e <stderr>] -- <cmd> [args ...]\n"); 50 printf("Usage: %s [-i <stdin>] [-o <stdout>] [-e <stderr>] -- <cmd> [args ...]\n", 51 NAME); 48 52 } 49 53 … … 72 76 static task_id_t spawn(int argc, char *argv[]) 73 77 { 74 c har **args = (char*) calloc(argc + 1, sizeof(char *));78 const char **args = (const char **) calloc(argc + 1, sizeof(char *)); 75 79 if (!args) { 76 80 printf("No memory available\n"); … … 84 88 args[argc] = NULL; 85 89 86 task_id_t id = task_spawn(argv[0], args); 90 int err; 91 task_id_t id = task_spawn(argv[0], args, &err); 87 92 88 93 free(args); 89 94 90 95 if (id == 0) 91 printf("Error spawning %s\n", argv[0]); 96 printf("%s: Error spawning %s (%s)\n", NAME, argv[0], 97 str_error(err)); 92 98 93 99 return id;
Note:
See TracChangeset
for help on using the changeset viewer.