From 28f43bbd488247dcc16a52b8b3393051bfb62037 Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Tue, 1 Oct 2002 07:23:59 +0000 Subject: [PATCH] + Updated entry_ref_is_root_dir() to Be style calling conventions + Added device_is_root_device() call git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1322 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/storage/kernel_interface.h | 5 ++++- src/kits/storage/kernel_interface.POSIX.cpp | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) 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