Changeset b40bfac in mainline for uspace/app/init/init.c
- Timestamp:
- 2010-11-08T07:13:25Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63a1e60
- Parents:
- d70a463 (diff), 3da12d74 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
rd70a463 rb40bfac 124 124 static void spawn(const char *fname) 125 125 { 126 const char *argv[2];126 int rc; 127 127 struct stat s; 128 128 … … 131 131 132 132 printf("%s: Spawning %s\n", NAME, fname); 133 134 argv[0] = fname; 135 argv[1] = NULL; 136 137 int err; 138 if (!task_spawn(fname, argv, &err)) 133 rc = task_spawnl(NULL, fname, fname, NULL); 134 if (rc != EOK) { 139 135 printf("%s: Error spawning %s (%s)\n", NAME, fname, 140 str_error(err)); 136 str_error(rc)); 137 } 141 138 } 142 139 143 140 static void srv_start(const char *fname) 144 141 { 145 const char *argv[2];146 142 task_id_t id; 147 143 task_exit_t texit; … … 153 149 154 150 printf("%s: Starting %s\n", NAME, fname); 155 156 argv[0] = fname; 157 argv[1] = NULL; 158 159 id = task_spawn(fname, argv, &retval); 151 rc = task_spawnl(&id, fname, fname, NULL); 160 152 if (!id) { 161 153 printf("%s: Error spawning %s (%s)\n", NAME, fname, 162 str_error(r etval));154 str_error(rc)); 163 155 return; 164 156 } … … 167 159 if (rc != EOK) { 168 160 printf("%s: Error waiting for %s (%s(\n", NAME, fname, 169 str_error(retval)); 170 return; 171 } 172 173 if ((texit != TASK_EXIT_NORMAL) || (retval != 0)) { 174 printf("%s: Server %s failed to start (%s)\n", NAME, 175 fname, str_error(retval)); 161 str_error(rc)); 162 return; 163 } 164 165 if (texit != TASK_EXIT_NORMAL) { 166 printf("%s: Server %s failed to start (unexpectedly " 167 "terminated)\n", NAME, fname); 168 return; 169 } 170 171 if (retval != 0) { 172 printf("%s: Server %s failed to start (exit code %d)\n", NAME, 173 fname, retval); 176 174 } 177 175 } … … 179 177 static void console(const char *dev) 180 178 { 181 const char *argv[3];182 179 char hid_in[DEVMAP_NAME_MAXLEN]; 183 180 int rc; … … 190 187 dev_handle_t handle; 191 188 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 192 193 if (rc == EOK) { 194 argv[0] = SRV_CONSOLE; 195 argv[1] = hid_in; 196 argv[2] = NULL; 197 198 if (!task_spawn(SRV_CONSOLE, argv, &rc)) 199 printf("%s: Error spawning %s %s (%s)\n", NAME, SRV_CONSOLE, 200 hid_in, str_error(rc)); 201 } else 189 if (rc != EOK) { 202 190 printf("%s: Error waiting on %s (%s)\n", NAME, hid_in, 203 191 str_error(rc)); 192 return; 193 } 194 195 rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, hid_in, NULL); 196 if (rc != EOK) { 197 printf("%s: Error spawning %s %s (%s)\n", NAME, SRV_CONSOLE, 198 hid_in, str_error(rc)); 199 } 204 200 } 205 201 206 202 static void getterm(const char *dev, const char *app) 207 203 { 208 const char *argv[4];209 204 char term[DEVMAP_NAME_MAXLEN]; 210 205 int rc; … … 217 212 dev_handle_t handle; 218 213 rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); 219 220 if (rc == EOK) { 221 argv[0] = APP_GETTERM; 222 argv[1] = term; 223 argv[2] = app; 224 argv[3] = NULL; 225 226 if (!task_spawn(APP_GETTERM, argv, &rc)) 227 printf("%s: Error spawning %s %s %s (%s)\n", NAME, APP_GETTERM, 228 term, app, str_error(rc)); 229 } else 214 if (rc != EOK) { 230 215 printf("%s: Error waiting on %s (%s)\n", NAME, term, 231 216 str_error(rc)); 217 return; 218 } 219 220 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app, NULL); 221 if (rc != EOK) { 222 printf("%s: Error spawning %s %s %s (%s)\n", NAME, 223 APP_GETTERM, term, app, str_error(rc)); 224 } 232 225 } 233 226
Note:
See TracChangeset
for help on using the changeset viewer.