Whenever KPath is used, it will now be tested if it could be initialized

(thanks to Ingo for the reminder...).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12652 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-05-12 23:31:04 +00:00
parent 90a0e0b9d9
commit 6bdc405f75
2 changed files with 51 additions and 1 deletions
+11
View File
@@ -500,6 +500,9 @@ publish_directory(struct devfs *fs, const char *path)
// copy the path over to a temp buffer so we can munge it
KPath tempPath(path);
if (tempPath.InitCheck() != B_OK)
return B_NO_MEMORY;
char *temp = tempPath.LockBuffer();
// create the path leading to the device
@@ -565,6 +568,9 @@ publish_node(struct devfs *fs, const char *path, struct devfs_vnode **_node)
// copy the path over to a temp buffer so we can munge it
KPath tempPath(path);
if (tempPath.InitCheck() != B_OK)
return B_NO_MEMORY;
char *temp = tempPath.LockBuffer();
// create the path leading to the device
@@ -871,6 +877,11 @@ devfs_lookup(fs_volume _fs, fs_vnode _dir, const char *name, vnode_id *_id, int
if (vnode == NULL) {
// scan for drivers in the given directory (that indicates the type of the driver)
KPath path;
if (path.InitCheck() != B_OK) {
err = B_NO_MEMORY;
goto err;
}
get_device_name(dir, path.LockBuffer(), path.BufferSize());
path.UnlockBuffer();
path.Append(name);