X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fnamespacize.c;h=545b28bb1a4f7d2dcd138b9a4fe9325907b81502;hp=2e6dcbfb9b3f5293b1cf2026bfc6c4930da128c4;hb=a40b318e7a07a452ae7456053727bd11b2fa49b4;hpb=b0f7eb297643941bd96eb209f35fbe223cd24e10 diff --git a/tools/namespacize.c b/tools/namespacize.c index 2e6dcbfb..545b28bb 100644 --- a/tools/namespacize.c +++ b/tools/namespacize.c @@ -406,7 +406,7 @@ static void setup_adjust_files(const char *dir, static void rename_files(const struct adjusted *adj) { while (adj) { - if (rename(adj->tmpfile, adj->file) != 0) + if (!move_file(adj->tmpfile, adj->file)) warn("Could not rename over '%s', we're in trouble", adj->file); adj = adj->next; @@ -457,9 +457,7 @@ static void adjust_dir(const char *dir) verbose("Adjusting %s\n", dir); verbose_indent(); - for (deps = get_deps(parent, parent, talloc_basename(parent, dir), - false); - *deps; deps++) { + for (deps = get_deps(parent, dir, false, NULL); *deps; deps++) { char *depdir; struct adjusted *adj = NULL; struct replace *repl; @@ -497,8 +495,7 @@ static void adjust_dependents(const char *dir) if (access(info, R_OK) != 0) continue; - for (deps = get_deps(*file, talloc_dirname(*file, *file), - talloc_basename(*file, *file), false); + for (deps = get_deps(*file, *file, false, NULL); *deps; deps++) { if (!strstarts(*deps, "ccan/")) continue;