From 93ef95559782f56532173dc3ee3f30aa70fda817 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sat, 5 Aug 2023 03:37:15 +0300 Subject: [PATCH] LibCore: Keep the raw inode number value in DirectoryEntry This will be used later on by other userspace programs that need it. --- Userland/Libraries/LibCore/DirectoryEntry.cpp | 2 ++ Userland/Libraries/LibCore/DirectoryEntry.h | 1 + 2 files changed, 3 insertions(+) diff --git a/Userland/Libraries/LibCore/DirectoryEntry.cpp b/Userland/Libraries/LibCore/DirectoryEntry.cpp index dfc16da66d..87d4f5c322 100644 --- a/Userland/Libraries/LibCore/DirectoryEntry.cpp +++ b/Userland/Libraries/LibCore/DirectoryEntry.cpp @@ -68,6 +68,7 @@ DirectoryEntry DirectoryEntry::from_stat(DIR* d, dirent const& de) return DirectoryEntry { .type = directory_entry_type_from_stat(statbuf.st_mode), .name = de.d_name, + .inode_number = de.d_ino, }; } @@ -77,6 +78,7 @@ DirectoryEntry DirectoryEntry::from_dirent(dirent const& de) return DirectoryEntry { .type = directory_entry_type_from_posix(de.d_type), .name = de.d_name, + .inode_number = de.d_ino, }; } #endif diff --git a/Userland/Libraries/LibCore/DirectoryEntry.h b/Userland/Libraries/LibCore/DirectoryEntry.h index 97ce7fe13b..83eed68958 100644 --- a/Userland/Libraries/LibCore/DirectoryEntry.h +++ b/Userland/Libraries/LibCore/DirectoryEntry.h @@ -26,6 +26,7 @@ struct DirectoryEntry { Type type; // FIXME: Once we have a special Path string class, use that. DeprecatedString name; + ino_t inode_number; static DirectoryEntry from_dirent(dirent const&); static DirectoryEntry from_stat(DIR*, dirent const&);