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