From 6c3245f6a79c8af8d5004e7749281a7855eda362 Mon Sep 17 00:00:00 2001 From: Marcus Overhagen Date: Sat, 6 Jan 2007 01:04:09 +0000 Subject: [PATCH] fixed error return in _Scan() function. now only returns B_OK when a device was found. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19716 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/disk_device_manager/KDiskDeviceManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp b/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp index 001bb8eae8..eecb23869f 100644 --- a/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp +++ b/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp @@ -1131,7 +1131,7 @@ status_t KDiskDeviceManager::_Scan(const char *path) { DBG(OUT("KDiskDeviceManager::_Scan(%s)\n", path)); - status_t error = B_OK; + status_t error = B_ENTRY_NOT_FOUND; struct stat st; if (lstat(path, &st) < 0) { return errno; @@ -1150,7 +1150,8 @@ DBG(OUT("KDiskDeviceManager::_Scan(%s)\n", path)); || entryPath.Append(entry->d_name) != B_OK) { continue; } - _Scan(entryPath.Path()); + if (_Scan(entryPath.Path()) == B_OK) + error = B_OK; } closedir(dir); } else { @@ -1166,7 +1167,7 @@ DBG(OUT(" found device: %s\n", path)); if (!device) return B_NO_MEMORY; // init the KDiskDevice - status_t error = device->SetTo(path); + error = device->SetTo(path); // add the device if (error == B_OK && !_AddDevice(device)) error = B_NO_MEMORY;