]> git.ozlabs.org Git - ccan/blobdiff - tools/manifest.c
fdpass: fix complilation on FreeBSD.
[ccan] / tools / manifest.c
index 6e246d8bf71de42a37f01ae4779102f57dd8d8ea..fcc2f15ba39231940e08b81dfed1ffa71df75314 100644 (file)
@@ -37,8 +37,8 @@ static bool dir_cmp(const struct manifest *m, const char *dir)
        return strcmp(m->dir, dir) == 0;
 }
 
-HTABLE_DEFINE_TYPE(struct manifest, manifest_name, dir_hash, dir_cmp,
-                  htable_manifest);
+HTABLE_DEFINE_NODUPS_TYPE(struct manifest, manifest_name, dir_hash, dir_cmp,
+                         htable_manifest);
 static struct htable_manifest *manifests;
 
 const char *get_ccan_file_contents(struct ccan_file *f)
@@ -112,8 +112,8 @@ static void add_files(struct manifest *m, const char *base, const char *subdir)
                f = new_ccan_file(m, m->dir,
                                  subdir ? path_join(m, subdir, ent->d_name)
                                  : ent->d_name);
-               if (lstat(f->fullname, &st) != 0)
-                       err(1, "lstat %s", f->fullname);
+               if (stat(f->fullname, &st) != 0)
+                       err(1, "stat %s", f->fullname);
 
                if (S_ISDIR(st.st_mode)) {
                        size_t len = tal_count(subs);
@@ -167,7 +167,7 @@ static void add_files(struct manifest *m, const char *base, const char *subdir)
                if (!m->info_file
                    && list_empty(&m->c_files)
                    && list_empty(&m->h_files))
-                       errx(1, "No _info, C or H files found here!");
+                       errx(1, "No _info, C or H files found in %s", thisdir);
 
                /* Don't enter subdirs with _info: they're separate modules. */
                for (i = 0; i < tal_count(subs); i++) {
@@ -183,7 +183,7 @@ static void add_files(struct manifest *m, const char *base, const char *subdir)
 }
 
 static int cmp_names(struct ccan_file *const *a, struct ccan_file *const *b,
-                    void *unused)
+                    void *unused UNNEEDED)
 {
        return strcmp((*a)->name, (*b)->name);
 }