Changeset 9286475 in mainline for uspace/lib/c/generic/loader.c


Ignore:
Timestamp:
2018-10-11T13:52:08Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8fefd8b
Parents:
63a045c
Message:

Set task name to full path instead of just the base name

This eliminates the guesswork it takes to determine path to the binary.
It is a stopgap measure. Eventually we want a better solution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/loader.c

    r63a045c r9286475  
    189189errno_t loader_set_program_path(loader_t *ldr, const char *path)
    190190{
    191         const char *name = str_rchr(path, '/');
    192         if (name == NULL) {
    193                 name = path;
    194         } else {
    195                 name++;
    196         }
     191        size_t abslen;
     192        char *abspath = vfs_absolutize(path, &abslen);
     193        if (!abspath)
     194                return ENOMEM;
    197195
    198196        int fd;
     
    202200        }
    203201
    204         rc = loader_set_program(ldr, name, fd);
     202        rc = loader_set_program(ldr, path, fd);
    205203        vfs_put(fd);
    206204        return rc;
Note: See TracChangeset for help on using the changeset viewer.