Changeset bdca26a in mainline for uspace/lib/c/generic/rtld/module.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/rtld/module.c

    r967e7a1 rbdca26a  
    6565
    6666        module = calloc(1, sizeof(module_t));
    67         if (module == NULL)
     67        if (module == NULL) {
     68                DPRINTF("malloc failed\n");
    6869                return ENOMEM;
     70        }
    6971
    7072        module->id = rtld_get_next_id(rtld);
     
    182184        char name_buf[NAME_BUF_SIZE];
    183185        module_t *m;
    184         int rc;
     186        errno_t rc;
    185187
    186188        m = calloc(1, sizeof(module_t));
    187189        if (m == NULL) {
    188                 printf("malloc failed\n");
     190                DPRINTF("malloc failed\n");
    189191                goto error;
    190192        }
     
    197199
    198200        if (str_size(name) > NAME_BUF_SIZE - 2) {
    199                 printf("soname too long. increase NAME_BUF_SIZE\n");
     201                DPRINTF("soname too long. increase NAME_BUF_SIZE\n");
    200202                goto error;
    201203        }
     
    208210
    209211        rc = elf_load_file_name(name_buf, RTLD_MODULE_LDF, &info);
    210         if (rc != EE_OK) {
    211                 printf("Failed to load '%s'\n", name_buf);
     212        if (rc != EOK) {
     213                DPRINTF("Failed to load '%s'\n", name_buf);
    212214                goto error;
    213215        }
     
    218220
    219221        if (info.dynamic == NULL) {
    220                 printf("Error: '%s' is not a dynamically-linked object.\n",
     222                DPRINTF("Error: '%s' is not a dynamically-linked object.\n",
    221223                    name_buf);
    222224                goto error;
     
    285287        m->deps = malloc(n * sizeof(module_t *));
    286288        if (!m->deps) {
    287                 printf("malloc failed\n");
     289                DPRINTF("malloc failed\n");
    288290                return ENOMEM;
    289291        }
Note: See TracChangeset for help on using the changeset viewer.