Changes in uspace/app/bdsh/exec.c [adb49f58:7e752b2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/exec.c
radb49f58 r7e752b2 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.