Skip to content

The default Rust runtime panics when println! and family write to a closed pipe. sigpipe fixes it with a single function call invoked at the start of your program.

License

Notifications You must be signed in to change notification settings

kurtbuilds/sigpipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Contributors Stars Build Status Downloads Crates.io

sigpipe

The default Rust runtime panics when println! and family write to a closed pipe. sigpipe fixes it with a single function call invoked at the start of your program.

Usage

fn main() {
    sigpipe::reset();
    // The rest of your program goes here.
}

Installation

# Using cargo-edit
cargo add sigpipe

# In your Cargo.toml
[dependencies]
sigpipe = "0.1"

Discussion

There have been several discussions about this issue. See:

Acknowledgments

This library is directly copied from @burntsushi's StackOverflow answer.

I made this library to package the solution, so users don't have to hunt for it online.

About

The default Rust runtime panics when println! and family write to a closed pipe. sigpipe fixes it with a single function call invoked at the start of your program.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages