diff --git a/headers/private/fs_shell/fssh_kernel_export.h b/headers/private/fs_shell/fssh_kernel_export.h index 32b23d43b2..bb143dc566 100644 --- a/headers/private/fs_shell/fssh_kernel_export.h +++ b/headers/private/fs_shell/fssh_kernel_export.h @@ -40,8 +40,8 @@ extern uint32_t fssh_parse_expression(const char *string); /* utility for debug typedef int (*fssh_debugger_command_hook)(int argc, char **argv); -extern int fssh_add_debugger_command(char *name, - fssh_debugger_command_hook hook, char *help); +extern int fssh_add_debugger_command(const char *name, + fssh_debugger_command_hook hook, const char *help); extern int fssh_remove_debugger_command(char *name, fssh_debugger_command_hook hook); diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 59d35db132..b6eea17a92 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -1670,7 +1670,8 @@ entry_ref_to_vnode(dev_t mountID, ino_t directoryID, const char *name, /*! Returns the vnode for the relative path starting at the specified \a vnode. \a path must not be NULL. If it returns successfully, \a path contains the name of the last path - component. + component. This function clobbers the buffer pointed to by \a path only + if it does contain more than one component. Note, this reduces the ref_count of the starting \a vnode, no matter if it is successful or not! */ @@ -4561,9 +4562,10 @@ fix_dirent(struct vnode *parent, struct dirent *entry) inc_vnode_ref_count(parent); // vnode_path_to_vnode() puts the node + // ".." is guaranteed to to be clobbered by this call struct vnode *vnode; - status_t status = vnode_path_to_vnode(parent, "..", false, 0, &vnode, - NULL, NULL); + status_t status = vnode_path_to_vnode(parent, (char*)"..", false, 0, + &vnode, NULL, NULL); if (status == B_OK) { entry->d_dev = vnode->device; diff --git a/src/tools/fs_shell/kernel_export.cpp b/src/tools/fs_shell/kernel_export.cpp index de321f9268..478aee8603 100644 --- a/src/tools/fs_shell/kernel_export.cpp +++ b/src/tools/fs_shell/kernel_export.cpp @@ -90,8 +90,8 @@ fssh_parse_expression(const char *string) int -fssh_add_debugger_command(char *name, fssh_debugger_command_hook hook, - char *help) +fssh_add_debugger_command(const char *name, fssh_debugger_command_hook hook, + const char *help) { return 0; } diff --git a/src/tools/fs_shell/vfs.cpp b/src/tools/fs_shell/vfs.cpp index 51d249a267..613df9ad94 100644 --- a/src/tools/fs_shell/vfs.cpp +++ b/src/tools/fs_shell/vfs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -1050,14 +1050,14 @@ entry_ref_to_vnode(fssh_mount_id mountID, fssh_vnode_id directoryID, const char } -/** Returns the vnode for the relative path starting at the specified \a vnode. - * \a path must not be NULL. - * If it returns successfully, \a path contains the name of the last path - * component. - * Note, this reduces the ref_count of the starting \a vnode, no matter if - * it is successful or not! - */ - +/*! Returns the vnode for the relative path starting at the specified \a vnode. + \a path must not be NULL. + If it returns successfully, \a path contains the name of the last path + component. This function clobbers the buffer pointed to by \a path only + if it does contain more than one component. + Note, this reduces the ref_count of the starting \a vnode, no matter if + it is successful or not! +*/ static fssh_status_t vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink, int count, struct vnode **_vnode, fssh_vnode_id *_parentID, int *_type) @@ -3237,9 +3237,10 @@ fix_dirent(struct vnode *parent, struct fssh_dirent *entry) inc_vnode_ref_count(parent); // vnode_path_to_vnode() puts the node + // ".." is guaranteed to to be clobbered by this call struct vnode *vnode; - fssh_status_t status = vnode_path_to_vnode(parent, "..", false, 0, &vnode, - NULL, NULL); + fssh_status_t status = vnode_path_to_vnode(parent, (char*)"..", false, + 0, &vnode, NULL, NULL); if (status == FSSH_B_OK) { entry->d_dev = vnode->device;