Skip to content

Limit poll migration to functional C++ changes and drop rebuilt binaries from PR#1

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-issue-3867
Open

Limit poll migration to functional C++ changes and drop rebuilt binaries from PR#1
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-issue-3867

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown

This update narrows the PR to the intended functional change only: replacing select()-based waits with poll() in the affected connection paths. It removes unintended binary refreshes and whitespace-only churn so review focuses on behavior changes.

  • Scope cleanup (no binary artifacts)

    • Excludes regenerated binaries/libraries from the proposed diff.
    • Keeps repository binary state unchanged relative to base for this PR.
  • Functional update: LanConnection

    • /src/libUnifiedLanComm/src/LanConnection.cpp
    • Uses poll() on non-Windows instead of select().
    • Captures socket under lock before waiting, with early invalid-FD handling.
    • Retries on EINTR.
    • Clamps timeout conversion to INT_MAX before passing to poll().
  • Functional update: UpstreamCharConnection

    • /src/multimacd/UpstreamCharConnection.cpp
    • Replaces loop-local select() fd-set flow with pollfd-based waiting.
    • Handles invalid FD explicitly.
    • Preserves existing event handling logic while switching readiness checks to poll revents.
pollfd pfd;
pfd.fd = currentSock;
pfd.events = POLLIN | POLLPRI | POLLERR | POLLHUP;
pfd.revents = 0;

int pollTimeout = (msTimeout > (unsigned int)INT_MAX) ? INT_MAX : (int)msTimeout;
do {
  nEvents = poll(&pfd, 1, pollTimeout);
} while (nEvents < 0 && errno == EINTR);

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.

2 participants