Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/program.c

    rdb675dd r692be1ae  
    8080        kernel_uarg->uspace_uarg = NULL;
    8181       
    82         prg->loader_status = EE_OK;
    8382        prg->task = task_create(as, name);
    8483        if (!prg->task)
     
    112111 * executable image. The task is returned in *task.
    113112 *
    114  * @param[in]  image_addr Address of an executable program image.
    115  * @param[in]  name       Name to set for the program's task.
    116  * @param[out] prg        Buffer for storing program info.
    117  *                        If image_addr points to a loader image,
    118  *                        prg->task will be set to NULL and EOK
    119  *                        will be returned.
     113 * @param image_addr Address of an executable program image.
     114 * @param name       Name to set for the program's task.
     115 * @param prg        Buffer for storing program info. If image_addr
     116 *                   points to a loader image, p->task will be set to
     117 *                   NULL and EOK will be returned.
    120118 *
    121119 * @return EOK on success or negative error code.
     
    128126                return ENOMEM;
    129127       
    130         prg->loader_status = elf_load((elf_header_t *) image_addr, as, 0);
    131         if (prg->loader_status != EE_OK) {
     128        unsigned int rc = elf_load((elf_header_t *) image_addr, as, 0);
     129        LOG("elf_load() -> %u\n", rc);
     130        if (rc != EE_OK) {
    132131                as_destroy(as);
    133132                prg->task = NULL;
    134133                prg->main_thread = NULL;
    135134               
    136                 if (prg->loader_status != EE_LOADER)
     135                if (rc != EE_LOADER)
    137136                        return ENOTSUP;
    138137               
     
    142141               
    143142                program_loader = image_addr;
    144                 printf("Program loader at %p\n", (void *) image_addr);
     143                LOG("Registered program loader at %p",
     144                    (void *) image_addr);
    145145               
    146146                return EOK;
     
    172172        }
    173173       
    174         prg->loader_status = elf_load((elf_header_t *) program_loader, as,
     174        unsigned int rc = elf_load((elf_header_t *) program_loader, as,
    175175            ELD_F_LOADER);
    176         if (prg->loader_status != EE_OK) {
     176        if (rc != EE_OK) {
    177177                as_destroy(as);
    178                 printf("Cannot spawn loader (%s)\n",
    179                     elf_error(prg->loader_status));
     178                printf("Cannot spawn loader (%s)\n", elf_error(rc));
    180179                return ENOENT;
    181180        }
Note: See TracChangeset for help on using the changeset viewer.