Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a34c579 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Don't call fdopendir on unique_fd::get."

parents 135828f3 b5aee72d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -16,10 +16,11 @@ namespace dvr {
class DirectoryReader {
 public:
  explicit DirectoryReader(base::unique_fd directory_fd) {
    directory_ = fdopendir(directory_fd.get());
    int fd = directory_fd.release();
    directory_ = fdopendir(fd);
    error_ = errno;
    if (directory_ != nullptr)
      (void) directory_fd.release(); // ignore return result?
    if (directory_ == nullptr)
      close(fd);
  }

  ~DirectoryReader() {