Changes in uspace/app/bdsh/exec.c [7e752b2:d9fae235] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/exec.c
r7e752b2 rd9fae235 41 41 #include <fcntl.h> 42 42 #include <str_error.h> 43 #include <errno.h>44 43 45 44 #include "config.h" … … 117 116 task_exit_t texit; 118 117 char *tmp; 119 int r c, retval;118 int retval; 120 119 121 120 tmp = str_dup(find_command(cmd)); 122 121 free(found); 123 122 124 rc = task_spawnv(&tid, tmp, (const char **) argv);123 tid = task_spawn(tmp, (const char **) argv, &retval); 125 124 free(tmp); 126 125 127 if ( rc != 0) {126 if (tid == 0) { 128 127 cli_error(CL_EEXEC, "%s: Cannot spawn `%s' (%s)", progname, cmd, 129 str_error(r c));128 str_error(retval)); 130 129 return 1; 131 130 } 132 131 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) { 132 task_wait(tid, &texit, &retval); 133 if (texit != TASK_EXIT_NORMAL) { 138 134 printf("%s: Command failed (unexpectedly terminated)\n", progname); 139 135 } else if (retval != 0) { 140 printf("%s: Command failed ( exit code %d)\n",141 progname, retval);136 printf("%s: Command failed (%s)\n", 137 progname, str_error(retval)); 142 138 } 143 139
Note:
See TracChangeset
for help on using the changeset viewer.