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