Changeset 15d0046 in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (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:

Merge mainline changes

File:
1 edited

Legend:

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

    r8db09e4 r15d0046  
    172172        va_start(ap, path);
    173173        task_id_t id;
    174         int rc = task_spawn(&id, path, cnt, ap);
     174        task_wait_t wait;
     175        int rc = task_spawn(&id, &wait, path, cnt, ap);
    175176        va_end(ap);
    176177       
     
    189190        task_exit_t texit;
    190191        int retval;
    191         rc = task_wait(id, &texit, &retval);
     192        rc = task_wait(&wait, &texit, &retval);
    192193        if (rc != EOK) {
    193194                printf("%s: Error waiting for %s (%s)\n", NAME, path,
     
    253254       
    254255        task_id_t id;
    255         int rc = task_spawnl(&id, app, app, winreg, NULL);
     256        task_wait_t wait;
     257        int rc = task_spawnl(&id, &wait, app, app, winreg, NULL);
    256258        if (rc != EOK) {
    257259                printf("%s: Error spawning %s %s (%s)\n", NAME, app,
     
    262264        task_exit_t texit;
    263265        int retval;
    264         rc = task_wait(id, &texit, &retval);
     266        rc = task_wait(&wait, &texit, &retval);
    265267        if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) {
    266268                printf("%s: Error retrieving retval from %s (%s)\n", NAME,
     
    272274}
    273275
    274 static void getterm(const char *svc, const char *app, bool wmsg)
    275 {
    276         char term[LOC_NAME_MAXLEN];
    277         snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc);
    278        
    279         printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app);
    280        
    281         /* Wait for the terminal service to be ready */
    282         service_id_t service_id;
    283         int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING);
    284         if (rc != EOK) {
    285                 printf("%s: Error waiting on %s (%s)\n", NAME, term,
    286                     str_error(rc));
    287                 return;
    288         }
    289        
    290         if (wmsg) {
    291                 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, "-w", term,
    292                     app, NULL);
    293                 if (rc != EOK) {
    294                         printf("%s: Error spawning %s -w %s %s (%s)\n", NAME,
    295                             APP_GETTERM, term, app, str_error(rc));
    296                 }
     276static void getterm(const char *svc, const char *app, bool msg)
     277{
     278        if (msg) {
     279                printf("%s: Spawning %s %s %s --msg --wait -- %s\n", NAME,
     280                    APP_GETTERM, svc, LOCFS_MOUNT_POINT, app);
     281               
     282                int rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc,
     283                    LOCFS_MOUNT_POINT, "--msg", "--wait", "--", app, NULL);
     284                if (rc != EOK)
     285                        printf("%s: Error spawning %s %s %s --msg --wait -- %s\n",
     286                            NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app);
    297287        } else {
    298                 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app,
    299                     NULL);
    300                 if (rc != EOK) {
    301                         printf("%s: Error spawning %s %s %s (%s)\n", NAME,
    302                             APP_GETTERM, term, app, str_error(rc));
    303                 }
     288                printf("%s: Spawning %s %s %s --wait -- %s\n", NAME,
     289                    APP_GETTERM, svc, LOCFS_MOUNT_POINT, app);
     290               
     291                int rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc,
     292                    LOCFS_MOUNT_POINT, "--wait", "--", app, NULL);
     293                if (rc != EOK)
     294                        printf("%s: Error spawning %s %s %s --wait -- %s\n",
     295                            NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app);
    304296        }
    305297}
     
    339331        srv_start("/srv/apic");
    340332        srv_start("/srv/i8259");
     333        srv_start("/srv/icp-ic");
    341334        srv_start("/srv/obio");
    342335        srv_start("/srv/cuda_adb");
     
    364357                gui_start("/app/vlaunch", HID_COMPOSITOR_SERVER);
    365358                gui_start("/app/vterm", HID_COMPOSITOR_SERVER);
    366         } else {
    367                 rc = console(HID_INPUT, HID_OUTPUT);
    368                 if (rc == EOK) {
    369                         getterm("term/vc0", "/app/bdsh", true);
    370                         getterm("term/vc1", "/app/bdsh", false);
    371                         getterm("term/vc2", "/app/bdsh", false);
    372                         getterm("term/vc3", "/app/bdsh", false);
    373                         getterm("term/vc4", "/app/bdsh", false);
    374                         getterm("term/vc5", "/app/bdsh", false);
    375                         getterm("term/vc6", "/app/klog", false);
    376                 }
     359        }
     360       
     361        rc = console(HID_INPUT, HID_OUTPUT);
     362        if (rc == EOK) {
     363                getterm("term/vc0", "/app/bdsh", true);
     364                getterm("term/vc1", "/app/bdsh", false);
     365                getterm("term/vc2", "/app/bdsh", false);
     366                getterm("term/vc3", "/app/bdsh", false);
     367                getterm("term/vc4", "/app/bdsh", false);
     368                getterm("term/vc5", "/app/bdsh", false);
    377369        }
    378370       
Note: See TracChangeset for help on using the changeset viewer.