Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset ddb844e in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2020-07-03T23:00:34Z (9 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
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.
Message:

Resolve merge conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/init/init.c

    redb57bc6 rddb844e  
    3434 */
    3535
     36#include <fibril.h>
    3637#include <stdio.h>
    3738#include <stdarg.h>
     
    4748#include <config.h>
    4849#include <io/logctl.h>
     50#include <vfs/vfs.h>
    4951#include <vol.h>
    5052#include "untar.h"
     
    6668#define APP_GETTERM  "/app/getterm"
    6769
    68 #define SRV_COMPOSITOR  "/srv/hid/compositor"
     70#define SRV_DISPLAY  "/srv/hid/display"
     71#define DISPLAY_SVC  "hid/display"
    6972
    7073#define HID_INPUT              "hid/input"
    7174#define HID_OUTPUT             "hid/output"
    72 #define HID_COMPOSITOR_SERVER  ":0"
    7375
    7476#define srv_start(path, ...) \
     
    271273}
    272274
    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);
     275static errno_t display_server(void)
     276{
     277        return srv_start(SRV_DISPLAY);
     278}
     279
     280static int gui_start(const char *app, const char *display_svc)
     281{
     282        printf("%s: Spawning %s\n", NAME, app);
    293283
    294284        task_id_t id;
    295285        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);
    297287        if (rc != EOK) {
    298288                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;
    302292        }
    303293
     
    480470
    481471        if (!config_key_exists("console")) {
    482                 rc = compositor(HID_INPUT, HID_COMPOSITOR_SERVER);
     472                rc = display_server();
    483473                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);
    487477                }
    488478        }
Note: See TracChangeset for help on using the changeset viewer.