Skip to content

Commit

Permalink
Correct defective return value in Posix::ls_with_sizes (#5037)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
eric-hughes-tiledb authored Jun 3, 2024
1 parent a872f29 commit 18cfeb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tiledb/sm/filesystem/posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ tuple<Status, optional<std::vector<directory_entry>>> 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<directory_entry>{}};
}

std::vector<directory_entry> entries;
Expand Down

0 comments on commit 18cfeb1

Please # to comment.