diff --git a/headers/private/storage/kernel_interface.h b/headers/private/storage/kernel_interface.h index 143db1d640..f24d02a264 100644 --- a/headers/private/storage/kernel_interface.h +++ b/headers/private/storage/kernel_interface.h @@ -321,7 +321,10 @@ status_t get_canonical_dir_path(const char *path, char *&result); status_t get_app_path(char *buffer); /*! Returns true if the given entry_ref represents the root directory, false otherwise. */ -bool entry_ref_is_root_dir(entry_ref &ref); +bool entry_ref_is_root_dir(const entry_ref *ref); + +//! Returns true if the given device is the root device, false otherwise +bool device_is_root_device(dev_t device); /*! Renames oldPath to newPath, replacing newPath if it exists. */ status_t rename(const char *oldPath, const char *newPath); diff --git a/src/kits/storage/kernel_interface.POSIX.cpp b/src/kits/storage/kernel_interface.POSIX.cpp index 807ccf1be9..74f399c397 100644 --- a/src/kits/storage/kernel_interface.POSIX.cpp +++ b/src/kits/storage/kernel_interface.POSIX.cpp @@ -1126,10 +1126,15 @@ BPrivate::Storage::get_app_path(char *buffer) } bool -BPrivate::Storage::entry_ref_is_root_dir( entry_ref &ref ) +BPrivate::Storage::entry_ref_is_root_dir( const entry_ref *ref ) { - return ref.directory == 1 && ref.device == 1 && ref.name[0] == '.' - && ref.name[1] == 0; + return ref && ref->directory == 1 && ref->device == 1 && ref->name[0] == '.' + && ref->name[1] == 0; +} + +bool +BPrivate::Storage::device_is_root_device(dev_t device) { + return device == 1; } status_t