From ec1f8d58da75d93328958213c8685da23de8094c Mon Sep 17 00:00:00 2001 From: Eric Hughes Date: Mon, 3 Jun 2024 10:40:27 -0600 Subject: [PATCH 1/2] Correct defective return value in `Posix::ls_with_sizes` PR #2671 introduced `ls_with_sizes`. There was a defect in `class Posix` where an empty directory return `nullopt` instead of an empty vector. This PR corrects that defect. I audited the original PR for possible related errors. This was the only one. --- tiledb/sm/filesystem/posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiledb/sm/filesystem/posix.cc b/tiledb/sm/filesystem/posix.cc index 58b4f0ab1d5..7846db9b0af 100644 --- a/tiledb/sm/filesystem/posix.cc +++ b/tiledb/sm/filesystem/posix.cc @@ -311,7 +311,7 @@ tuple>> Posix::ls_with_sizes( struct dirent* next_path = nullptr; DIR* dir = opendir(path.c_str()); if (dir == nullptr) { - return {Status::Ok(), nullopt}; + return {Status::Ok(), std::vector entries; From 3e7d16ed7a8a67d6abaad6ec407104b63549f9e3 Mon Sep 17 00:00:00 2001 From: Eric Hughes Date: Mon, 3 Jun 2024 10:55:28 -0600 Subject: [PATCH 2/2] Typo --- tiledb/sm/filesystem/posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiledb/sm/filesystem/posix.cc b/tiledb/sm/filesystem/posix.cc index 7846db9b0af..4b8011f2510 100644 --- a/tiledb/sm/filesystem/posix.cc +++ b/tiledb/sm/filesystem/posix.cc @@ -311,7 +311,7 @@ tuple>> Posix::ls_with_sizes( struct dirent* next_path = nullptr; DIR* dir = opendir(path.c_str()); if (dir == nullptr) { - return {Status::Ok(), std::vector{}}; } std::vector entries;