fix: correct misleading SIGPIPE comment (#776)
The comment said "Ignore SIGPIPE" but the code actually resets SIGPIPE to SIG_DFL (default behavior = process termination), not SIG_IGN (ignore). Updated the comment to accurately describe what the code does and why. Co-authored-by: hyunjinee <leehj0110@kakao.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
hyunjinee
Claude Opus 4.6
parent
790123f9af
commit
67986adffc
+2
-1
@@ -164,7 +164,8 @@ fn run_session(args: &[String], session: &str, json_mode: bool) {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// Ignore SIGPIPE to prevent panic when piping to head/tail
|
||||
// Rust ignores SIGPIPE by default, causing println! to panic on broken pipes.
|
||||
// Reset to SIG_DFL so the OS terminates the process cleanly instead.
|
||||
#[cfg(unix)]
|
||||
unsafe {
|
||||
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
|
||||
|
||||
Reference in New Issue
Block a user