diff options
author | Ben Peart <peartben@gmail.com> | 2017-05-05 11:28:02 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-15 13:01:57 +0900 |
commit | 4f2a2e9f0e26c1c543d1f282d6e88b3d0f608d07 (patch) | |
tree | e6f92f415fc89c7c982773020acfa7bd5964477e /convert.c | |
parent | 99605d62e8e7e568035dc953b24b79b3d52f0522 (diff) | |
download | git-4f2a2e9f0e26c1c543d1f282d6e88b3d0f608d07.tar.gz |
convert: update subprocess_read_status() to not die on EOFbp/sub-process-convert-filter
Enable sub-processes to gracefully handle when the process dies by
updating subprocess_read_status to return an error on EOF instead of
dying.
Update apply_multi_file_filter to take advantage of the revised
subprocess_read_status.
Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'convert.c')
-rw-r--r-- | convert.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -635,7 +635,10 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len if (err) goto done; - subprocess_read_status(process->out, &filter_status); + err = subprocess_read_status(process->out, &filter_status); + if (err) + goto done; + err = strcmp(filter_status.buf, "success"); if (err) goto done; @@ -644,7 +647,10 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len if (err) goto done; - subprocess_read_status(process->out, &filter_status); + err = subprocess_read_status(process->out, &filter_status); + if (err) + goto done; + err = strcmp(filter_status.buf, "success"); done: |