Changeset ddb844e in mainline for uspace/app/init/init.c
- Timestamp:
- 2020-07-03T23:00:34Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e79a025
- Parents:
- edb57bc6 (diff), 1a1c75e (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
redb57bc6 rddb844e 34 34 */ 35 35 36 #include <fibril.h> 36 37 #include <stdio.h> 37 38 #include <stdarg.h> … … 47 48 #include <config.h> 48 49 #include <io/logctl.h> 50 #include <vfs/vfs.h> 49 51 #include <vol.h> 50 52 #include "untar.h" … … 66 68 #define APP_GETTERM "/app/getterm" 67 69 68 #define SRV_COMPOSITOR "/srv/hid/compositor" 70 #define SRV_DISPLAY "/srv/hid/display" 71 #define DISPLAY_SVC "hid/display" 69 72 70 73 #define HID_INPUT "hid/input" 71 74 #define HID_OUTPUT "hid/output" 72 #define HID_COMPOSITOR_SERVER ":0"73 75 74 76 #define srv_start(path, ...) \ … … 271 273 } 272 274 273 static errno_t compositor(const char *isvc, const char *name) 274 { 275 /* Wait for the input service to be ready */ 276 service_id_t service_id; 277 errno_t rc = loc_service_get_id(isvc, &service_id, IPC_FLAG_BLOCKING); 278 if (rc != EOK) { 279 printf("%s: Error waiting on %s (%s)\n", NAME, isvc, 280 str_error(rc)); 281 return rc; 282 } 283 284 return srv_start(SRV_COMPOSITOR, isvc, name); 285 } 286 287 static int gui_start(const char *app, const char *srv_name) 288 { 289 char winreg[50]; 290 snprintf(winreg, sizeof(winreg), "%s%s%s", "comp", srv_name, "/winreg"); 291 292 printf("%s: Spawning %s %s\n", NAME, app, winreg); 275 static errno_t display_server(void) 276 { 277 return srv_start(SRV_DISPLAY); 278 } 279 280 static int gui_start(const char *app, const char *display_svc) 281 { 282 printf("%s: Spawning %s\n", NAME, app); 293 283 294 284 task_id_t id; 295 285 task_wait_t wait; 296 errno_t rc = task_spawnl(&id, &wait, app, app, winreg, NULL);286 errno_t rc = task_spawnl(&id, &wait, app, app, display_svc, NULL); 297 287 if (rc != EOK) { 298 288 oom_check(rc, app); 299 printf("%s: Error spawning %s %s(%s)\n", NAME, app,300 winreg,str_error(rc));301 return rc;289 printf("%s: Error spawning %s (%s)\n", NAME, app, 290 str_error(rc)); 291 return -1; 302 292 } 303 293 … … 480 470 481 471 if (!config_key_exists("console")) { 482 rc = compositor(HID_INPUT, HID_COMPOSITOR_SERVER);472 rc = display_server(); 483 473 if (rc == EOK) { 484 gui_start("/app/barber", HID_COMPOSITOR_SERVER);485 gui_start("/app/vlaunch", HID_COMPOSITOR_SERVER);486 gui_start("/app/vterm", HID_COMPOSITOR_SERVER);474 gui_start("/app/barber", DISPLAY_SVC); 475 gui_start("/app/vlaunch", DISPLAY_SVC); 476 gui_start("/app/vterm", DISPLAY_SVC); 487 477 } 488 478 }
Note:
See TracChangeset
for help on using the changeset viewer.