Changeset 46c20c8 in mainline for uspace/app/redir/redir.c
- Timestamp:
- 2010-11-26T20:08:10Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 45df59a
- Parents:
- fb150d78 (diff), ffdd2b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
uspace/app/redir/redir.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/redir/redir.c
rfb150d78 r46c20c8 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 #include <errno.h> 46 47 #define NAME "redir" 44 48 45 49 static void usage(void) 46 50 { 47 printf("Usage: redir [-i <stdin>] [-o <stdout>] [-e <stderr>] -- <cmd> [args ...]\n"); 51 printf("Usage: %s [-i <stdin>] [-o <stdout>] [-e <stderr>] -- <cmd> [args ...]\n", 52 NAME); 48 53 } 49 54 … … 72 77 static task_id_t spawn(int argc, char *argv[]) 73 78 { 74 char **args = (char *) calloc(argc + 1, sizeof(char *)); 79 const char **args; 80 task_id_t id = 0; 81 int rc; 82 83 args = (const char **) calloc(argc + 1, sizeof(char *)); 75 84 if (!args) { 76 85 printf("No memory available\n"); … … 84 93 args[argc] = NULL; 85 94 86 task_id_t id = task_spawn(argv[0], args);95 rc = task_spawnv(&id, argv[0], args); 87 96 88 97 free(args); 89 98 90 if (id == 0) 91 printf("Error spawning %s\n", argv[0]); 99 if (rc != EOK) { 100 printf("%s: Error spawning %s (%s)\n", NAME, argv[0], 101 str_error(rc)); 102 } 92 103 93 104 return id;
Note:
See TracChangeset
for help on using the changeset viewer.
