summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-09-23 20:44:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-23 20:44:46 (GMT)
commitb5866edf97c19bea2b0557beeaec4223ad54e202 (patch)
treeffb375221f59cd4b90bff62c90647ce5209cc331
parentffb03876084218ce73363dbd45482b4a39582897 (diff)
parent3218cb753f5a2a49808bf07f039051e7b79b8f44 (diff)
downloadgit-b5866edf97c19bea2b0557beeaec4223ad54e202.zip
git-b5866edf97c19bea2b0557beeaec4223ad54e202.tar.gz
git-b5866edf97c19bea2b0557beeaec4223ad54e202.tar.bz2
Merge branch 'ab/gc-remove-unused-call'
Code clean-up. * ab/gc-remove-unused-call: gc: remove unused launchctl_get_uid() call
-rw-r--r--builtin/gc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index b00b396..6b3de3d 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -1681,9 +1681,7 @@ static int launchctl_remove_plists(void)
static int launchctl_list_contains_plist(const char *name, const char *cmd)
{
- int result;
struct child_process child = CHILD_PROCESS_INIT;
- char *uid = launchctl_get_uid();
strvec_split(&child.args, cmd);
strvec_pushl(&child.args, "list", name, NULL);
@@ -1694,12 +1692,8 @@ static int launchctl_list_contains_plist(const char *name, const char *cmd)
if (start_command(&child))
die(_("failed to start launchctl"));
- result = finish_command(&child);
-
- free(uid);
-
/* Returns failure if 'name' doesn't exist. */
- return !result;
+ return !finish_command(&child);
}
static int launchctl_schedule_plist(const char *exec_path, enum schedule_priority schedule)