Changeset bdca26a in mainline for uspace/lib/c/generic/elf/elf_load.c


Ignore:
Timestamp:
2019-05-26T13:21:50Z (5 years ago)
Author:
Jakub Jermář <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8aea932
Parents:
967e7a1
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-05-17 14:27:34)
git-committer:
Jakub Jermář <jakub@…> (2019-05-26 13:21:50)
Message:

Removing printf when failing from lib/rtld

If rtld failed a message was printed with printf.
This has been replaced with DPRINTF which
gives control to the developer over the message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/elf/elf_load.c

    r967e7a1 rbdca26a  
    5353 * @param file File handle
    5454 * @param info Place to store ELF program information
    55  * @return EE_OK on success or an EE_x error code
     55 * @return EOK on success or an error code
    5656 */
    57 int elf_load(int file, elf_info_t *info)
     57errno_t elf_load(int file, elf_info_t *info)
    5858{
    5959#ifdef CONFIG_RTLD
    6060        rtld_t *env;
    6161#endif
    62         int rc;
     62        errno_t rc;
    6363
    6464        rc = elf_load_file(file, 0, &info->finfo);
    65         if (rc != EE_OK) {
     65        if (rc != EOK) {
    6666                DPRINTF("Failed to load executable '%s'.\n", file_name);
    6767                return rc;
     
    7272                DPRINTF("Binary is statically linked.\n");
    7373                info->env = NULL;
    74                 return EE_OK;
     74                return EOK;
    7575        }
    7676
     
    7979        DPRINTF("- prog dynamic: %p\n", info->finfo.dynamic);
    8080
    81         errno_t rc2 = rtld_prog_process(&info->finfo, &env);
    82         switch (rc2) {
    83         case EOK:
    84                 rc = EE_OK;
    85                 break;
    86         case ENOMEM:
    87                 rc = EE_MEMORY;
    88                 break;
    89         default:
    90                 DPRINTF("Unexpected error code from rtld_prog_process(): %s\n", str_error_name(rc2));
    91                 rc = EE_INVALID;
    92         }
    93 
     81        rc = rtld_prog_process(&info->finfo, &env);
    9482        info->env = env;
    9583#else
    96         rc = EE_UNSUPPORTED;
     84        rc = ENOTSUP;
    9785#endif
    9886        return rc;
Note: See TracChangeset for help on using the changeset viewer.