Re: [PATCH v5 6/8] convert: rename reusable sub-process functions
flat view
From: Lars Schneider <hidden>
Date: 2017-04-10 12:11:16
quoted hunk ↗ jump to hunk
On 07 Apr 2017, at 14:03, Ben Peart [off-list ref] wrote: Do a mechanical rename of the functions that will become the reusable sub-process module. Signed-off-by: Ben Peart <redacted> --- convert.c | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-)diff --git a/convert.c b/convert.c index 747c0c363b..235a6a5279 100644 --- a/convert.c +++ b/convert.c@@ -507,8 +507,8 @@ struct cmd2process {unsigned int supported_capabilities; };
...
quoted hunk ↗ jump to hunk
-static void kill_multi_file_filter(struct subprocess_entry *entry) +static void subprocess_stop(struct subprocess_entry *entry) { if (!entry) return;@@ -561,14 +561,14 @@ static void kill_multi_file_filter(struct subprocess_entry *entry)kill(entry->process.pid, SIGTERM); finish_command(&entry->process); - hashmap_remove(&cmd_process_map, entry, NULL); + hashmap_remove(&subprocess_map, entry, NULL); free(entry); }
...
quoted hunk ↗ jump to hunk
@@ -777,7 +777,8 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len* Force shutdown and restart if another blob requires filtering. */ error("external filter '%s' failed", cmd); - kill_multi_file_filter((struct subprocess_entry *)entry); + subprocess_stop((struct subprocess_entry *)entry); + free(entry);
I think we perform a double "free" here and in subprocess_stop(), no? Everything else looks good to me! Thanks, Lars