Add symbol versioning for find_directory()
Should already have been done back when the semantics for the B_COMMON_*DIRECTORY constants was changed. Currently old and new version behave the same. So this is just a contingency measure ATM.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
#include <../private/system/find_directory_private.h>
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright 2013, Ingo Weinhold, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _SYSTEM_FIND_DIRECTORY_PRIVATE_H
|
||||
#define _SYSTEM_FIND_DIRECTORY_PRIVATE_H
|
||||
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <FindDirectory.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
|
||||
status_t __find_directory(directory_which which, dev_t device, bool createIt,
|
||||
char *returnedPath, int32 pathLength);
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif /* _SYSTEM_FIND_DIRECTORY_PRIVATE_H */
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#include <StorageDefs.h>
|
||||
|
||||
#include <find_directory_private.h>
|
||||
|
||||
|
||||
#ifndef HAIKU_BUILD_GENERATED_DIRECTORY
|
||||
# error HAIKU_BUILD_GENERATED_DIRECTORY not defined!
|
||||
@@ -95,3 +97,10 @@ find_directory(directory_which which, dev_t device, bool createIt,
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
__find_directory(directory_which which, dev_t device, bool createIt,
|
||||
char *returnedPath, int32 pathLength)
|
||||
{
|
||||
return find_directory(which, device, createIt, returnedPath, pathLength);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <boot_device.h>
|
||||
#include <boot/kernel_args.h>
|
||||
#include <elf.h>
|
||||
#include <find_directory_private.h>
|
||||
#include <fs/devfs.h>
|
||||
#include <fs/KPath.h>
|
||||
#include <fs/node_monitor.h>
|
||||
@@ -515,7 +516,7 @@ get_priority(const char* path)
|
||||
|
||||
for (uint32 index = 0; index < sizeof(whichPath) / sizeof(whichPath[0]);
|
||||
index++) {
|
||||
if (find_directory(whichPath[index], gBootDevice, false,
|
||||
if (__find_directory(whichPath[index], gBootDevice, false,
|
||||
pathBuffer.LockBuffer(), pathBuffer.BufferSize()) == B_OK) {
|
||||
pathBuffer.UnlockBuffer();
|
||||
if (!strncmp(pathBuffer.Path(), path, pathBuffer.BufferSize()))
|
||||
@@ -954,7 +955,7 @@ DirectoryIterator::SetTo(const char* path, const char* subPath, bool recursive)
|
||||
if (i < 2 && disableUserAddOns)
|
||||
continue;
|
||||
|
||||
if (find_directory(whichPath[i], gBootDevice, true,
|
||||
if (__find_directory(whichPath[i], gBootDevice, true,
|
||||
pathBuffer.LockBuffer(), pathBuffer.BufferSize()) == B_OK) {
|
||||
pathBuffer.UnlockBuffer();
|
||||
pathBuffer.Append("kernel");
|
||||
@@ -1388,7 +1389,7 @@ legacy_driver_add_preloaded(kernel_args* args)
|
||||
// NOTE: The initialization success of the path objects is implicitely
|
||||
// checked by the immediately following functions.
|
||||
KPath basePath;
|
||||
status_t status = find_directory(B_BEOS_ADDONS_DIRECTORY,
|
||||
status_t status = __find_directory(B_BEOS_ADDONS_DIRECTORY,
|
||||
gBootDevice, false, basePath.LockBuffer(), basePath.BufferSize());
|
||||
if (status != B_OK) {
|
||||
dprintf("legacy_driver_add_preloaded: find_directory() failed: "
|
||||
@@ -1496,7 +1497,7 @@ legacy_driver_probe(const char* subPath)
|
||||
if (i < 2 && disableUserAddOns)
|
||||
continue;
|
||||
|
||||
if (find_directory(whichPath[i], gBootDevice, true,
|
||||
if (__find_directory(whichPath[i], gBootDevice, true,
|
||||
path.LockBuffer(), path.BufferSize()) == B_OK) {
|
||||
path.UnlockBuffer();
|
||||
path.Append("kernel/drivers");
|
||||
|
||||
@@ -11,3 +11,6 @@ KERNEL_1_ALPHA3 {
|
||||
|
||||
KERNEL_1_ALPHA4 {
|
||||
} KERNEL_1_ALPHA3;
|
||||
|
||||
KERNEL_1_ALPHA5 {
|
||||
} KERNEL_1_ALPHA4;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <debug.h>
|
||||
#include <DPC.h>
|
||||
#include <elf.h>
|
||||
#include <find_directory_private.h>
|
||||
#include <fs/devfs.h>
|
||||
#include <fs/KPath.h>
|
||||
#include <int.h>
|
||||
@@ -341,7 +342,7 @@ main2(void *unused)
|
||||
// start the init process
|
||||
{
|
||||
KPath bootScriptPath;
|
||||
status_t status = find_directory(B_SYSTEM_BOOT_DIRECTORY, gBootDevice,
|
||||
status_t status = __find_directory(B_SYSTEM_BOOT_DIRECTORY, gBootDevice,
|
||||
false, bootScriptPath.LockBuffer(), bootScriptPath.BufferSize());
|
||||
if (status != B_OK)
|
||||
dprintf("main2: find_directory() failed: %s\n", strerror(status));
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <boot/elf.h>
|
||||
#include <boot/kernel_args.h>
|
||||
#include <elf.h>
|
||||
#include <find_directory_private.h>
|
||||
#include <fs/KPath.h>
|
||||
#include <fs/node_monitor.h>
|
||||
#include <lock.h>
|
||||
@@ -639,7 +640,7 @@ search_module(const char* name, module_image** _moduleImage)
|
||||
// let the VFS find that module for us
|
||||
|
||||
KPath basePath;
|
||||
if (find_directory(kModulePaths[i], gBootDevice, true,
|
||||
if (__find_directory(kModulePaths[i], gBootDevice, true,
|
||||
basePath.LockBuffer(), basePath.BufferSize()) != B_OK)
|
||||
continue;
|
||||
|
||||
@@ -1436,7 +1437,7 @@ ModuleNotificationService::_AddDirectory(const char* prefix)
|
||||
break;
|
||||
|
||||
KPath pathBuffer;
|
||||
if (find_directory(kModulePaths[i], gBootDevice, true,
|
||||
if (__find_directory(kModulePaths[i], gBootDevice, true,
|
||||
pathBuffer.LockBuffer(), pathBuffer.BufferSize()) != B_OK)
|
||||
continue;
|
||||
|
||||
@@ -1607,7 +1608,7 @@ ModuleNotificationService::_Notify(int32 opcode, dev_t device, ino_t directory,
|
||||
|
||||
for (uint32 i = 0; i < kNumModulePaths; i++) {
|
||||
KPath modulePath;
|
||||
if (find_directory(kModulePaths[i], gBootDevice, true,
|
||||
if (__find_directory(kModulePaths[i], gBootDevice, true,
|
||||
modulePath.LockBuffer(), modulePath.BufferSize()) != B_OK)
|
||||
continue;
|
||||
|
||||
@@ -1889,7 +1890,7 @@ module_init_post_boot_device(bool bootingFromBootLoaderVolume)
|
||||
if (sDisableUserAddOns && i >= kFirstNonSystemModulePath)
|
||||
continue;
|
||||
|
||||
if (find_directory(kModulePaths[i], gBootDevice, true,
|
||||
if (__find_directory(kModulePaths[i], gBootDevice, true,
|
||||
pathBuffer.LockBuffer(), pathBuffer.BufferSize())
|
||||
!= B_OK) {
|
||||
pathBuffer.UnlockBuffer();
|
||||
@@ -2008,7 +2009,7 @@ open_module_list_etc(const char* prefix, const char* suffix)
|
||||
break;
|
||||
|
||||
KPath pathBuffer;
|
||||
if (find_directory(kModulePaths[i], gBootDevice, true,
|
||||
if (__find_directory(kModulePaths[i], gBootDevice, true,
|
||||
pathBuffer.LockBuffer(), pathBuffer.BufferSize()) != B_OK)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <boot_device.h>
|
||||
#include <elf.h>
|
||||
#include <file_cache.h>
|
||||
#include <find_directory_private.h>
|
||||
#include <fs/KPath.h>
|
||||
#include <heap.h>
|
||||
#include <int.h>
|
||||
@@ -1601,7 +1602,7 @@ team_create_thread_start_internal(void* args)
|
||||
{
|
||||
// find runtime_loader path
|
||||
KPath runtimeLoaderPath;
|
||||
err = find_directory(B_SYSTEM_DIRECTORY, gBootDevice, false,
|
||||
err = __find_directory(B_SYSTEM_DIRECTORY, gBootDevice, false,
|
||||
runtimeLoaderPath.LockBuffer(), runtimeLoaderPath.BufferSize());
|
||||
if (err < B_OK) {
|
||||
TRACE(("team_create_thread_start: find_directory() failed: %s\n",
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
#include <StorageDefs.h>
|
||||
|
||||
#include <errno_private.h>
|
||||
#include <find_directory_private.h>
|
||||
|
||||
|
||||
static status_t
|
||||
get_path(char *path, bool create)
|
||||
{
|
||||
status_t status = find_directory(B_SYSTEM_SETTINGS_DIRECTORY, -1, create,
|
||||
status_t status = __find_directory(B_SYSTEM_SETTINGS_DIRECTORY, -1, create,
|
||||
path, B_PATH_NAME_LENGTH);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
@@ -6,3 +6,6 @@ LIBROOT_1_ALPHA1 {
|
||||
|
||||
LIBROOT_1_ALPHA4 {
|
||||
} LIBROOT_1_ALPHA1;
|
||||
|
||||
LIBROOT_1_ALPHA5 {
|
||||
} LIBROOT_1_ALPHA4;
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
#ifdef _BOOT_MODE
|
||||
# include <boot/kernel_args.h>
|
||||
# include <boot/stage2.h>
|
||||
#else
|
||||
# include <find_directory_private.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -767,7 +769,7 @@ load_driver_settings(const char *driverName)
|
||||
strcpy(path, kUserSettingsDirectory);
|
||||
#else
|
||||
// TODO: use B_SYSTEM_SETTINGS_DIRECTORY instead!
|
||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, path,
|
||||
if (__find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, path,
|
||||
sizeof(path)) == B_OK)
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <errno_private.h>
|
||||
#include <find_directory_private.h>
|
||||
#include <symbol_versioning.h>
|
||||
#include <user_group.h>
|
||||
|
||||
/* use pwents to find home */
|
||||
@@ -211,7 +213,7 @@ create_path(const char *path, mode_t mode)
|
||||
|
||||
|
||||
status_t
|
||||
find_directory(directory_which which, dev_t device, bool createIt,
|
||||
__find_directory(directory_which which, dev_t device, bool createIt,
|
||||
char *returnedPath, int32 pathLength)
|
||||
{
|
||||
status_t err = B_OK;
|
||||
@@ -443,3 +445,17 @@ find_directory(directory_which which, dev_t device, bool createIt,
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
extern "C" status_t
|
||||
__find_directory_alpha4(directory_which which, dev_t device, bool createIt,
|
||||
char *returnedPath, int32 pathLength)
|
||||
{
|
||||
return __find_directory(which, device, createIt, returnedPath, pathLength);
|
||||
}
|
||||
|
||||
|
||||
DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__find_directory_alpha4",
|
||||
"find_directory@", "BASE");
|
||||
|
||||
DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__find_directory", "find_directory@@",
|
||||
"1_ALPHA5");
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
#include <StorageDefs.h>
|
||||
|
||||
#include <errno_private.h>
|
||||
#include <find_directory_private.h>
|
||||
|
||||
|
||||
static status_t
|
||||
get_path(char *path, bool create)
|
||||
{
|
||||
status_t status = find_directory(B_SYSTEM_SETTINGS_DIRECTORY, -1, create,
|
||||
status_t status = __find_directory(B_SYSTEM_SETTINGS_DIRECTORY, -1, create,
|
||||
path, B_PATH_NAME_LENGTH);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user