mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
Merge branch 'jb/filter-ignore-sigpipe' into maint
* jb/filter-ignore-sigpipe: Ignore SIGPIPE when running a filter driver
This commit is contained in:
commit
c08afaf7b6
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include "attr.h"
|
#include "attr.h"
|
||||||
#include "run-command.h"
|
#include "run-command.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
|
#include "sigchain.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* convert.c - convert a file when checking it out and checking it in.
|
* convert.c - convert a file when checking it out and checking it in.
|
||||||
|
@ -360,12 +361,16 @@ static int filter_buffer(int in, int out, void *data)
|
||||||
if (start_command(&child_process))
|
if (start_command(&child_process))
|
||||||
return error("cannot fork to run external filter %s", params->cmd);
|
return error("cannot fork to run external filter %s", params->cmd);
|
||||||
|
|
||||||
|
sigchain_push(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
write_err = (write_in_full(child_process.in, params->src, params->size) < 0);
|
write_err = (write_in_full(child_process.in, params->src, params->size) < 0);
|
||||||
if (close(child_process.in))
|
if (close(child_process.in))
|
||||||
write_err = 1;
|
write_err = 1;
|
||||||
if (write_err)
|
if (write_err)
|
||||||
error("cannot feed the input to external filter %s", params->cmd);
|
error("cannot feed the input to external filter %s", params->cmd);
|
||||||
|
|
||||||
|
sigchain_pop(SIGPIPE);
|
||||||
|
|
||||||
status = finish_command(&child_process);
|
status = finish_command(&child_process);
|
||||||
if (status)
|
if (status)
|
||||||
error("external filter %s failed %d", params->cmd, status);
|
error("external filter %s failed %d", params->cmd, status);
|
||||||
|
|
Loading…
Reference in a new issue