Skip to content

fix: add missing #include <csignal> in coro_io.hpp#1152

Merged
poor-circle merged 1 commit intoalibaba:mainfrom
00fish0:fix/add-missing-csignal-include
Mar 4, 2026
Merged

fix: add missing #include <csignal> in coro_io.hpp#1152
poor-circle merged 1 commit intoalibaba:mainfrom
00fish0:fix/add-missing-csignal-include

Conversation

@00fish0
Copy link
Copy Markdown
Contributor

@00fish0 00fish0 commented Feb 26, 2026

Why

coro_io.hpp uses std::signal(), SIGPIPE and SIG_IGN (line 769, inside #ifdef linux) but does not include . When no other transitively-included header happens to bring in , compilation fails.

This was discovered while building other library which depends on yalantinglibs. The full error log:

/usr/local/include/ylt/coro_io/coro_io.hpp: In lambda function:
/usr/local/include/ylt/coro_io/coro_io.hpp:769:8: error: 'signal' is not a member of 'std'
  769 |   std::signal(SIGPIPE, SIG_IGN);
      |        ^~~~~~
/usr/local/include/ylt/coro_io/coro_io.hpp:769:15: error: 'SIGPIPE' was not declared in this scope
  769 |   std::signal(SIGPIPE, SIG_IGN);
      |               ^~~~~~~
/usr/local/include/ylt/coro_io/coro_io.hpp:769:24: error: 'SIG_IGN' was not declared in this scope
  769 |   std::signal(SIGPIPE, SIG_IGN);
      |                        ^~~~~~~

The pipe_signal_handler lambda inside #ifdef linux calls std::signal(SIGPIPE, SIG_IGN), which requires . Previously this worked by accident because some other header in the include chain transitively pulled in . When the downstream project's include order differs, this implicit dependency breaks.

What is changing

Add #include to coro_io.hpp.

Copilot AI review requested due to automatic review settings February 26, 2026 18:47
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 26, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown

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

Adds the missing standard header needed for the Linux-only SIGPIPE ignore handler in coro_io.hpp, preventing build failures when <csignal> is not transitively included by other headers.

Changes:

  • Include <csignal> in include/ylt/coro_io/coro_io.hpp to support std::signal, SIGPIPE, and SIG_IGN usage under #ifdef __linux__.

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

@github-actions
Copy link
Copy Markdown

for detail, goto summary download Artifacts base-ylt-cov-report(base commit coverage report) and ylt-cov-report(current pull request coverage report)

@poor-circle
Copy link
Copy Markdown
Collaborator

LGTM

@poor-circle poor-circle merged commit 7d7252f into alibaba:main Mar 4, 2026
33 of 35 checks passed
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.

4 participants