Skip to content

Conversation

@ks734
Copy link
Contributor

@ks734 ks734 commented Feb 3, 2026

Description

Added proper fd validation and avoids closing the same fd twice

Test Procedure

How to test this PR (if applicable)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (doesn't fit into the above categories - e.g. documentation updates)

Requires Bitbake Recipe changes?

  • The base Bitbake recipe (meta-rdk-ext/recipes-containers/dobby/dobby.bb) must be modified to support the changes in this PR (beyond updating SRC_REV)

Copilot AI review requested due to automatic review settings February 3, 2026 10:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a double-close issue in the FileSink destructor by adding proper file descriptor validation and preventing the same fd from being closed twice. The fix ensures that when the output file cannot be opened and falls back to /dev/null, the destructor correctly handles cleanup without attempting to close the same file descriptor twice.

Changes:

  • Updated fd validation from > 0 to >= 0 to correctly handle all valid Unix file descriptors (including stdin/fd 0)
  • Added a check in the destructor to prevent closing mOutputFileFd when it points to the same fd as mDevNullFd
  • Reordered the close operations to close mOutputFileFd before mDevNullFd with proper validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant