diff options
author | Norbert Preining <norbert@preining.info> | 2019-10-12 03:00:57 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-10-12 03:00:57 +0000 |
commit | 2e4672ed6f7b49c9d1c44b6ca850cfe7024fc639 (patch) | |
tree | 8cc5672ceb359cb652306244d63afc5f7d939008 /graphics/asymptote/pipestream.cc | |
parent | d51deaad31c304a71b51411feaf44acceb8aeb1b (diff) |
CTAN sync 201910120300
Diffstat (limited to 'graphics/asymptote/pipestream.cc')
-rw-r--r-- | graphics/asymptote/pipestream.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/graphics/asymptote/pipestream.cc b/graphics/asymptote/pipestream.cc index f7f3006c01..8e8abba34d 100644 --- a/graphics/asymptote/pipestream.cc +++ b/graphics/asymptote/pipestream.cc @@ -32,6 +32,14 @@ #include "camperror.h" #include "pen.h" +iopipestream *instance; + +void pipeHandler(int) +{ + Signal(SIGPIPE,SIG_DFL); + instance->pipeclose(); +} + void iopipestream::open(const mem::vector<string> &command, const char *hint, const char *application, int out_fileno) { @@ -70,9 +78,11 @@ void iopipestream::open(const mem::vector<string> &command, const char *hint, char **argv=args(command); if(argv) execvp(argv[0],argv); execError(argv[0],hint,application); - kill(0,SIGTERM); + kill(0,SIGPIPE); _exit(-1); } + instance=this; + Signal(SIGPIPE,pipeHandler); close(out[1]); close(in[0]); *buffer=0; |