Changes in uspace/app/init/init.c [527298a:991f645] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
r527298a r991f645 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; … … 188 185 189 186 /* Wait for the input device to be ready */ 190 dev _handle_t handle;187 devmap_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)); 204 } 205 206 static void getterm(const char *dev, const char *app) 207 { 208 const char *argv[4]; 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 } 200 } 201 202 static void getterm(const char *dev, const char *app, bool wmsg) 203 { 209 204 char term[DEVMAP_NAME_MAXLEN]; 210 205 int rc; … … 215 210 216 211 /* Wait for the terminal device to be ready */ 217 dev _handle_t handle;212 devmap_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 if (wmsg) { 221 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, "-w", term, 222 app, NULL); 223 if (rc != EOK) { 224 printf("%s: Error spawning %s -w %s %s (%s)\n", NAME, 225 APP_GETTERM, term, app, str_error(rc)); 226 } 227 } else { 228 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app, 229 NULL); 230 if (rc != EOK) { 231 printf("%s: Error spawning %s %s %s (%s)\n", NAME, 232 APP_GETTERM, term, app, str_error(rc)); 233 } 234 } 232 235 } 233 236 … … 302 305 #endif 303 306 304 getterm("term/vc0", "/app/bdsh" );305 getterm("term/vc1", "/app/bdsh" );306 getterm("term/vc2", "/app/bdsh" );307 getterm("term/vc3", "/app/bdsh" );308 getterm("term/vc4", "/app/bdsh" );309 getterm("term/vc5", "/app/bdsh" );310 getterm("term/vc6", "/app/klog" );307 getterm("term/vc0", "/app/bdsh", true); 308 getterm("term/vc1", "/app/bdsh", false); 309 getterm("term/vc2", "/app/bdsh", false); 310 getterm("term/vc3", "/app/bdsh", false); 311 getterm("term/vc4", "/app/bdsh", false); 312 getterm("term/vc5", "/app/bdsh", false); 313 getterm("term/vc6", "/app/klog", false); 311 314 312 315 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.