mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Ignore SIGPIPE (#3627)
This replicates what the Rust runtime does, and matches what Rust code expects, for example when writing to a socket which is no longer connected to the remote end.
This commit is contained in:
parent
d75ef7f197
commit
c95dc9d149
1 changed files with 5 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <Context.h>
|
||||
#include <rust/cxx.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
@ -39,6 +40,10 @@
|
|||
int main(int argc, const char** argv) {
|
||||
int status{0};
|
||||
|
||||
// Ignore SIGPIPE from writes to network sockets after the remote end has hung
|
||||
// up. Rust code expects this, and the Rust runtime ignores this signal at startup.
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
Context globalContext;
|
||||
Context::setContext(&globalContext);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue