* Corrected and improved debug output.

* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37577 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-07-19 09:20:29 +00:00
parent 7071dfc1d1
commit 98e415e567
@@ -1343,18 +1343,19 @@ legacy_driver_add_preloaded(kernel_args* args)
// NOTE: The initialization success of the path objects is implicitely // NOTE: The initialization success of the path objects is implicitely
// checked by the immediately following functions. // checked by the immediately following functions.
KPath basePath; KPath basePath;
status_t pathStatus = find_directory(B_BEOS_ADDONS_DIRECTORY, status_t status = find_directory(B_BEOS_ADDONS_DIRECTORY,
gBootDevice, false, basePath.LockBuffer(), basePath.BufferSize()); gBootDevice, false, basePath.LockBuffer(), basePath.BufferSize());
if (pathStatus != B_OK) { if (status != B_OK) {
dprintf("devfs_add_preloaded_drivers: find_directory() failed: " dprintf("legacy_driver_add_preloaded: find_directory() failed: "
"%s\n", strerror(pathStatus)); "%s\n", strerror(status));
} }
basePath.UnlockBuffer(); basePath.UnlockBuffer();
if (pathStatus == B_OK) if (status == B_OK)
pathStatus = basePath.Append("kernel"); status = basePath.Append("kernel");
if (pathStatus != B_OK) { if (status != B_OK) {
dprintf("devfs_add_preloaded_drivers: constructing base driver " dprintf("legacy_driver_add_preloaded: constructing base driver "
"path failed: %s\n", strerror(pathStatus)); "path failed: %s\n", strerror(status));
return;
} }
struct preloaded_image* image; struct preloaded_image* image;
@@ -1363,18 +1364,17 @@ legacy_driver_add_preloaded(kernel_args* args)
continue; continue;
KPath imagePath(basePath); KPath imagePath(basePath);
if (pathStatus == B_OK) status = imagePath.Append(image->name);
pathStatus = imagePath.Append(image->name);
// try to add the driver // try to add the driver
TRACE(("devfs_add_preloaded_drivers: adding driver %s\n", TRACE(("legacy_driver_add_preloaded: adding driver %s\n",
imagePath.Path())); imagePath.Path()));
status_t addStatus = pathStatus;
if (pathStatus == B_OK) if (status == B_OK)
addStatus = add_driver(imagePath.Path(), image->id); status = add_driver(imagePath.Path(), image->id);
if (addStatus != B_OK) { if (status != B_OK) {
dprintf("devfs_add_preloaded_drivers: Failed to add \"%s\"\n", dprintf("legacy_driver_add_preloaded: Failed to add \"%s\": %s\n",
image->name); image->name, strerror(status));
unload_kernel_add_on(image->id); unload_kernel_add_on(image->id);
} }
} }