From: "René Scharfe" <l.s.r@web.de>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
Stefan Beller <sbeller@google.com>
Subject: [PATCH v2 1/3] run-command: name the cleanup function child_process_clear()
Date: Sat, 31 Oct 2015 10:19:15 +0100 [thread overview]
Message-ID: <56348793.5040909@web.de> (raw)
In-Reply-To: <56348709.9080207@web.de>
Rename child_process_deinit() to child_process_clear() in order to stay
consistent with similar cleanup functions like argv_array_clear(),
string_list_clear() etc.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
run-command.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/run-command.c b/run-command.c
index 82cc238..b10ec75 100644
--- a/run-command.c
+++ b/run-command.c
@@ -13,7 +13,7 @@ void child_process_init(struct child_process *child)
argv_array_init(&child->env_array);
}
-static void child_process_deinit(struct child_process *child)
+static void child_process_clear(struct child_process *child)
{
argv_array_clear(&child->args);
argv_array_clear(&child->env_array);
@@ -335,7 +335,7 @@ int start_command(struct child_process *cmd)
fail_pipe:
error("cannot create %s pipe for %s: %s",
str, cmd->argv[0], strerror(failed_errno));
- child_process_deinit(cmd);
+ child_process_clear(cmd);
errno = failed_errno;
return -1;
}
@@ -520,7 +520,7 @@ fail_pipe:
close_pair(fderr);
else if (cmd->err)
close(cmd->err);
- child_process_deinit(cmd);
+ child_process_clear(cmd);
errno = failed_errno;
return -1;
}
@@ -546,7 +546,7 @@ fail_pipe:
int finish_command(struct child_process *cmd)
{
int ret = wait_or_whine(cmd->pid, cmd->argv[0], 0);
- child_process_deinit(cmd);
+ child_process_clear(cmd);
return ret;
}
@@ -990,7 +990,7 @@ static void pp_cleanup(struct parallel_processes *pp)
for (i = 0; i < pp->max_processes; i++) {
strbuf_release(&pp->children[i].err);
- child_process_deinit(&pp->children[i].process);
+ child_process_clear(&pp->children[i].process);
}
free(pp->children);
@@ -1157,7 +1157,7 @@ static int pp_collect_finished(struct parallel_processes *pp)
pp->nr_processes--;
pp->children[i].in_use = 0;
pp->pfd[i].fd = -1;
- child_process_deinit(&pp->children[i].process);
+ child_process_clear(&pp->children[i].process);
child_process_init(&pp->children[i].process);
if (i != pp->output_owner) {
--
2.6.2
next prev parent reply other threads:[~2015-10-31 9:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-31 9:16 [PATCH v2 0/3] daemon: plug memory leak René Scharfe
2015-10-31 9:19 ` René Scharfe [this message]
2015-10-31 9:20 ` [PATCH v2 2/3] run-command: export child_process_clear() René Scharfe
2015-10-31 9:20 ` [PATCH v2 3/3] daemon: plug memory leak René Scharfe
2015-10-31 13:53 ` [PATCH v2 0/3] " Jeff King
2015-10-31 20:32 ` Stefan Beller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56348793.5040909@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.