From 6165b3afe402099a7473a1f518dc26ea3b74ee84 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 30 Aug 2011 09:25:39 +0930 Subject: [PATCH 1/1] tools: simplify get_safe_ccan_deps There's no reason to hand in the name of the compiled _info file, since we don't compile it up in safe mode. --- tools/ccan_depends.c | 2 +- tools/ccanlint/compulsory_tests/depends_exist.c | 3 +-- tools/depends.c | 6 +++--- tools/tools.h | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/ccan_depends.c b/tools/ccan_depends.c index b055e44e..4dda6fa2 100644 --- a/tools/ccan_depends.c +++ b/tools/ccan_depends.c @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) recurse, NULL); else deps = get_safe_ccan_deps(talloc_autofree_context(), - argv[1], recurse, NULL); + argv[1], recurse); for (i = 0; deps[i]; i++) if (strstarts(deps[i], "ccan/") == ccan) diff --git a/tools/ccanlint/compulsory_tests/depends_exist.c b/tools/ccanlint/compulsory_tests/depends_exist.c index b6be1f94..a90a7196 100644 --- a/tools/ccanlint/compulsory_tests/depends_exist.c +++ b/tools/ccanlint/compulsory_tests/depends_exist.c @@ -45,8 +45,7 @@ static void check_depends_exist(struct manifest *m, *strrchr(updir, '/') = '\0'; if (safe_mode) - deps = get_safe_ccan_deps(m, m->dir, true, - &m->info_file->compiled); + deps = get_safe_ccan_deps(m, m->dir, true); else deps = get_deps(m, m->dir, true, &m->info_file->compiled); diff --git a/tools/depends.c b/tools/depends.c index 16f7cb69..efb42004 100644 --- a/tools/depends.c +++ b/tools/depends.c @@ -255,11 +255,11 @@ char **get_deps(const void *ctx, const char *dir, } char **get_safe_ccan_deps(const void *ctx, const char *dir, - bool recurse, char **infofile) + bool recurse) { if (!recurse) { unsigned int num; - return get_one_safe_deps(ctx, dir, &num, infofile); + return get_one_safe_deps(ctx, dir, &num, NULL); } - return get_all_deps(ctx, dir, infofile, get_one_safe_deps); + return get_all_deps(ctx, dir, NULL, get_one_safe_deps); } diff --git a/tools/tools.h b/tools/tools.h index f08eb1dd..f3e132d9 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -24,8 +24,7 @@ char **get_deps(const void *ctx, const char *dir, bool recurse, char **infofile); /* This is safer: just looks for ccan/ strings in info */ -char **get_safe_ccan_deps(const void *ctx, const char *dir, - bool recurse, char **infofile); +char **get_safe_ccan_deps(const void *ctx, const char *dir, bool recurse); /* This also needs to compile the info file. */ char **get_libs(const void *ctx, const char *dir, -- 2.39.2