Ticket #2185: team.cpp.diff

File team.cpp.diff, 1.4 KB (added by kaoutsis, 11 years ago)
  • src/system/kernel/team.cpp

     
    1616#include <OS.h>
    1717
    1818#include <AutoDeleter.h>
     19#include <FindDirectory.h>
    1920
     21#include <boot_device.h>
    2022#include <elf.h>
    2123#include <file_cache.h>
     24#include <fs/KPath.h>
    2225#include <heap.h>
    2326#include <int.h>
    2427#include <kernel.h>
     
    11161119    free_team_arg(teamArgs);
    11171120        // the arguments are already on the user stack, we no longer need them in this form
    11181121
    1119     // ToDo: don't use fixed paths!
    1120     err = elf_load_user_image("/boot/beos/system/runtime_loader", team, 0, &entry);
     1122    // find runtime_loader path
     1123    KPath runtimeLoaderPath;
     1124    err = find_directory(B_BEOS_SYSTEM_DIRECTORY, gBootDevice, false,
     1125        runtimeLoaderPath.LockBuffer(), runtimeLoaderPath.BufferSize());
    11211126    if (err < B_OK) {
     1127        TRACE(("team_create_thread_start: error when find_directory() %s\n", strerror(err)));
     1128        return err;
     1129    }
     1130    runtimeLoaderPath.UnlockBuffer();
     1131    runtimeLoaderPath.Append("runtime_loader");
     1132
     1133    err = elf_load_user_image(runtimeLoaderPath.Path(), team, 0, &entry);
     1134    if (err < B_OK) {
    11221135        // Luckily, we don't have to clean up the mess we created - that's
    11231136        // done for us by the normal team deletion process
    11241137        TRACE(("team_create_thread_start: error when elf_load_user_image() %s\n", strerror(err)));