Re: [PATCH v8 03/11] run-command: move check_pipe() from write_or_die to run_command
On 26 September 2016 at 18:13, Lars Schneider wrote: >> On 25 Sep 2016, at 00:12, Jakub Narębski wrote: >> W dniu 20.09.2016 o 21:02, larsxschnei...@gmail.com pisze: >>> From: Lars Schneider >>> >>> Move check_pipe() to run_command and make it public. This is necessary >>> to call the function from pkt-line in a subsequent patch. >> >> All right. > > Does this mean I can add your "Acked-by: Jakub Narebski " ? Well, Acked-by makes sense if it is from subsystem maintainer. I can only claim gitweb subsystem where my ACKs might make sense. This "All right" is here to note that I have read this patch (and not skipped it), and I have't found anything to complain about or nitpick ;-P Best, -- Jakub Narębski
Re: [PATCH v8 03/11] run-command: move check_pipe() from write_or_die to run_command
> On 25 Sep 2016, at 00:12, Jakub Narębski wrote: > > W dniu 20.09.2016 o 21:02, larsxschnei...@gmail.com pisze: >> From: Lars Schneider >> >> Move check_pipe() to run_command and make it public. This is necessary >> to call the function from pkt-line in a subsequent patch. > > All right. Does this mean I can add your "Acked-by: Jakub Narebski " ? Thanks, Lars
Re: [PATCH v8 03/11] run-command: move check_pipe() from write_or_die to run_command
W dniu 20.09.2016 o 21:02, larsxschnei...@gmail.com pisze: > From: Lars Schneider > > Move check_pipe() to run_command and make it public. This is necessary > to call the function from pkt-line in a subsequent patch. All right. > > Signed-off-by: Lars Schneider > --- > run-command.c | 13 + > run-command.h | 2 ++ > write_or_die.c | 13 - > 3 files changed, 15 insertions(+), 13 deletions(-) Diffstat looks correct. Not to add to your burden, but perhaps somebody could add to his/her TODO documenting check_pipe() in Documentation/technical/api-run-command.txt Or is it not worth it? Best regards, -- Jakub Narębski
[PATCH v8 03/11] run-command: move check_pipe() from write_or_die to run_command
From: Lars Schneider Move check_pipe() to run_command and make it public. This is necessary to call the function from pkt-line in a subsequent patch. Signed-off-by: Lars Schneider --- run-command.c | 13 + run-command.h | 2 ++ write_or_die.c | 13 - 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/run-command.c b/run-command.c index 5a4dbb6..b72f6d1 100644 --- a/run-command.c +++ b/run-command.c @@ -6,6 +6,19 @@ #include "thread-utils.h" #include "strbuf.h" +void check_pipe(int err) +{ + if (err == EPIPE) { + if (in_async()) + async_exit(141); + + signal(SIGPIPE, SIG_DFL); + raise(SIGPIPE); + /* Should never happen, but just in case... */ + exit(141); + } +} + void child_process_init(struct child_process *child) { memset(child, 0, sizeof(*child)); diff --git a/run-command.h b/run-command.h index 5066649..e7c5f71 100644 --- a/run-command.h +++ b/run-command.h @@ -54,6 +54,8 @@ int finish_command(struct child_process *); int finish_command_in_signal(struct child_process *); int run_command(struct child_process *); +void check_pipe(int err); + /* * Returns the path to the hook file, or NULL if the hook is missing * or disabled. Note that this points to static storage that will be diff --git a/write_or_die.c b/write_or_die.c index 0734432..eab8c8d 100644 --- a/write_or_die.c +++ b/write_or_die.c @@ -1,19 +1,6 @@ #include "cache.h" #include "run-command.h" -static void check_pipe(int err) -{ - if (err == EPIPE) { - if (in_async()) - async_exit(141); - - signal(SIGPIPE, SIG_DFL); - raise(SIGPIPE); - /* Should never happen, but just in case... */ - exit(141); - } -} - /* * Some cases use stdio, but want to flush after the write * to get error handling (and to get better interactive -- 2.10.0