File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ BVolume::SetTo(dev_t device)
7272 // uninitialize
7373 Unset ();
7474 // check the parameter
75- status_t error = (device >= 0 ? B_OK : B_BAD_VALUE);
75+ status_t error = (device != B_INVALID_DEV ? B_OK : B_BAD_VALUE);
7676 if (error == B_OK) {
7777 fs_info info;
7878 if (fs_stat_dev (device, &info) != 0 )
@@ -117,7 +117,13 @@ BVolume::GetRootDirectory(BDirectory *directory) const
117117 error = errno;
118118 // init the directory
119119 if (error == B_OK) {
120- node_ref ref (info.dev , info.root );
120+ int dirFd = _kern_open_entry_ref (info.dev , info.root , NULL ,
121+ O_RDWR, 0 );
122+
123+ if (dirFd < 0 )
124+ return dirFd;
125+
126+ node_ref ref (dirFd);
121127 error = directory->SetTo (&ref);
122128 }
123129 return error;
You can’t perform that action at this time.
0 commit comments