From 18cfeb16afd2d6baf86fcd20a6035ad1c7982cc3 Mon Sep 17 00:00:00 2001 From: eric-hughes-tiledb <82400964+eric-hughes-tiledb@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:51:36 -0600 Subject: [PATCH] Correct defective return value in `Posix::ls_with_sizes` (#5037) PR #2671 introduced `ls_with_sizes`. There was a defect in `class Posix` where an empty directory returned `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. [sc-48646] --- TYPE: BUG DESC: Correct defective return value in `Posix::ls_with_sizes` --- 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..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(), nullopt}; + return {Status::Ok(), std::vector{}}; } std::vector entries;