* Explained under which circumstances vnode_path_to_vnode() will clobber the
buffer of the provided "path" argument.
* Applied patch by Vasilis to fix some warnings when build on Linux (missing
const on certain functions). We should probably fix the original
{add|remove}_debugger_command() functions in Haiku as well.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24322 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -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);
|
typedef int (*fssh_debugger_command_hook)(int argc, char **argv);
|
||||||
|
|
||||||
extern int fssh_add_debugger_command(char *name,
|
extern int fssh_add_debugger_command(const char *name,
|
||||||
fssh_debugger_command_hook hook, char *help);
|
fssh_debugger_command_hook hook, const char *help);
|
||||||
extern int fssh_remove_debugger_command(char *name,
|
extern int fssh_remove_debugger_command(char *name,
|
||||||
fssh_debugger_command_hook hook);
|
fssh_debugger_command_hook hook);
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
/*! Returns the vnode for the relative path starting at the specified \a vnode.
|
||||||
\a path must not be NULL.
|
\a path must not be NULL.
|
||||||
If it returns successfully, \a path contains the name of the last path
|
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
|
Note, this reduces the ref_count of the starting \a vnode, no matter if
|
||||||
it is successful or not!
|
it is successful or not!
|
||||||
*/
|
*/
|
||||||
@@ -4561,9 +4562,10 @@ fix_dirent(struct vnode *parent, struct dirent *entry)
|
|||||||
inc_vnode_ref_count(parent);
|
inc_vnode_ref_count(parent);
|
||||||
// vnode_path_to_vnode() puts the node
|
// vnode_path_to_vnode() puts the node
|
||||||
|
|
||||||
|
// ".." is guaranteed to to be clobbered by this call
|
||||||
struct vnode *vnode;
|
struct vnode *vnode;
|
||||||
status_t status = vnode_path_to_vnode(parent, "..", false, 0, &vnode,
|
status_t status = vnode_path_to_vnode(parent, (char*)"..", false, 0,
|
||||||
NULL, NULL);
|
&vnode, NULL, NULL);
|
||||||
|
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
entry->d_dev = vnode->device;
|
entry->d_dev = vnode->device;
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ fssh_parse_expression(const char *string)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
fssh_add_debugger_command(char *name, fssh_debugger_command_hook hook,
|
fssh_add_debugger_command(const char *name, fssh_debugger_command_hook hook,
|
||||||
char *help)
|
const char *help)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-11
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
* 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.
|
/*! Returns the vnode for the relative path starting at the specified \a vnode.
|
||||||
* \a path must not be NULL.
|
\a path must not be NULL.
|
||||||
* If it returns successfully, \a path contains the name of the last path
|
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
|
||||||
* Note, this reduces the ref_count of the starting \a vnode, no matter if
|
if it does contain more than one component.
|
||||||
* it is successful or not!
|
Note, this reduces the ref_count of the starting \a vnode, no matter if
|
||||||
*/
|
it is successful or not!
|
||||||
|
*/
|
||||||
static fssh_status_t
|
static fssh_status_t
|
||||||
vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink,
|
vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink,
|
||||||
int count, struct vnode **_vnode, fssh_vnode_id *_parentID, int *_type)
|
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);
|
inc_vnode_ref_count(parent);
|
||||||
// vnode_path_to_vnode() puts the node
|
// vnode_path_to_vnode() puts the node
|
||||||
|
|
||||||
|
// ".." is guaranteed to to be clobbered by this call
|
||||||
struct vnode *vnode;
|
struct vnode *vnode;
|
||||||
fssh_status_t status = vnode_path_to_vnode(parent, "..", false, 0, &vnode,
|
fssh_status_t status = vnode_path_to_vnode(parent, (char*)"..", false,
|
||||||
NULL, NULL);
|
0, &vnode, NULL, NULL);
|
||||||
|
|
||||||
if (status == FSSH_B_OK) {
|
if (status == FSSH_B_OK) {
|
||||||
entry->d_dev = vnode->device;
|
entry->d_dev = vnode->device;
|
||||||
|
|||||||
Reference in New Issue
Block a user