Rev 4617 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4617 | Rev 4620 | ||
|---|---|---|---|
| Line 110... | Line 110... | ||
| 110 | } |
110 | } |
| 111 | 111 | ||
| 112 | unsigned int try_exec(char *cmd, char **argv) |
112 | unsigned int try_exec(char *cmd, char **argv) |
| 113 | { |
113 | { |
| 114 | task_id_t tid; |
114 | task_id_t tid; |
| - | 115 | task_exit_t texit; |
|
| 115 | char *tmp; |
116 | char *tmp; |
| 116 | int retval; |
117 | int retval; |
| 117 | 118 | ||
| 118 | tmp = str_dup(find_command(cmd)); |
119 | tmp = str_dup(find_command(cmd)); |
| 119 | free(found); |
120 | free(found); |
| Line 124... | Line 125... | ||
| 124 | if (tid == 0) { |
125 | if (tid == 0) { |
| 125 | cli_error(CL_EEXEC, "Cannot spawn `%s'.", cmd); |
126 | cli_error(CL_EEXEC, "Cannot spawn `%s'.", cmd); |
| 126 | return 1; |
127 | return 1; |
| 127 | } |
128 | } |
| 128 | 129 | ||
| 129 | task_wait(tid, &retval); |
130 | task_wait(tid, &texit, &retval); |
| - | 131 | if (texit != TASK_EXIT_NORMAL) { |
|
| - | 132 | printf("Command failed (unexpectedly terminated).\n"); |
|
| 130 | if (retval != 0) |
133 | } else if (retval != 0) { |
| 131 | printf("Command failed (return value %d).\n", retval); |
134 | printf("Command failed (return value %d).\n", retval); |
| - | 135 | } |
|
| 132 | 136 | ||
| 133 | return 0; |
137 | return 0; |
| 134 | } |
138 | } |