42daa4642a781e88f86984a04d826d845679fd1c markd Thu Jul 25 21:40:11 2013 -0700 enable SIGPIPE on linefile gzip subprocesses to allow closing the reading of compressed files before EOF is reached diff --git src/inc/pipeline.h src/inc/pipeline.h index 7fa1870..00ad819 100644 --- src/inc/pipeline.h +++ src/inc/pipeline.h @@ -64,33 +64,34 @@ */ #ifndef PIPELINE_H #define PIPELINE_H #include struct linefile; struct pipeline; enum pipelineOpts /* pipeline options bitset */ { pipelineRead = 0x01, /* read from pipeline */ pipelineWrite = 0x02, /* write to pipeline */ pipelineNoAbort = 0x04, /* don't abort if a process exits non-zero, * wait will return exit code instead. * Still aborts if process signals. */ + pipelineMemInput = 0x08, /* pipeline takes input from memory (internal) */ pipelineAppend = 0x10, /* Append to output file (used only with pipelineWrite) */ - /* these are internal options */ - pipelineMemInput = 0x08 /* pipeline takes input from memory */ + pipelineSigpipe = 0x20 /* enable sigpipe in the children and don't treat + as an error in the parent */ }; struct pipeline *pipelineOpenFd(char ***cmds, unsigned opts, int otherEndFd, int stderrFd); /* Create a pipeline from an array of commands. Each command is an array of * arguments. Shell expansion is not done on the arguments. If pipelineRead * is specified, the output of the pipeline is readable from the pipeline * object. If pipelineWrite is specified, the input of the pipeline is * writable from the pipeline object. */ struct pipeline *pipelineOpen(char ***cmds, unsigned opts, char *otherEndFile, char *stderrFile); /* Create a pipeline from an array of commands. Each command is an array of * arguments. Shell expansion is not done on the arguments. If pipelineRead * is specified, the output of the pipeline is readable from the pipeline