Changeset 04803bf in mainline for uspace/app/bdsh/exec.c
- Timestamp:
- 2011-03-21T22:00:17Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 143932e3
- Parents:
- b50b5af2 (diff), 7308e84 (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/bdsh/exec.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/exec.c
rb50b5af2 r04803bf 38 38 #include <stdlib.h> 39 39 #include <unistd.h> 40 #include <str ing.h>40 #include <str.h> 41 41 #include <fcntl.h> 42 #include <str_error.h> 43 #include <errno.h> 42 44 43 45 #include "config.h" … … 115 117 task_exit_t texit; 116 118 char *tmp; 117 int r etval;119 int rc, retval; 118 120 119 121 tmp = str_dup(find_command(cmd)); 120 122 free(found); 121 123 122 tid = task_spawn((const char *)tmp,argv);124 rc = task_spawnv(&tid, tmp, (const char **) argv); 123 125 free(tmp); 124 126 125 if (tid == 0) { 126 cli_error(CL_EEXEC, "Cannot spawn `%s'.", cmd); 127 if (rc != 0) { 128 cli_error(CL_EEXEC, "%s: Cannot spawn `%s' (%s)", progname, cmd, 129 str_error(rc)); 127 130 return 1; 128 131 } 129 132 130 task_wait(tid, &texit, &retval); 131 if (texit != TASK_EXIT_NORMAL) { 132 printf("Command failed (unexpectedly terminated).\n"); 133 rc = task_wait(tid, &texit, &retval); 134 if (rc != EOK) { 135 printf("%s: Failed waiting for command (%s)\n", progname, 136 str_error(rc)); 137 } else if (texit != TASK_EXIT_NORMAL) { 138 printf("%s: Command failed (unexpectedly terminated)\n", progname); 133 139 } else if (retval != 0) { 134 printf("Command failed (return value %d).\n", retval); 140 printf("%s: Command failed (exit code %d)\n", 141 progname, retval); 135 142 } 136 143
Note:
See TracChangeset
for help on using the changeset viewer.
