summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-12-27 16:17:32 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-12-27 16:17:32 +0000
commit13f6fb15011d3da3e11665ae0bf03a083112e2e6 (patch)
tree17bf46453c428661ac0097227c6826727566042f
parent998dc67b25ca9f6a3f7875ff78741be3c1c7ee51 (diff)
downloadmandoc-13f6fb15011d3da3e11665ae0bf03a083112e2e6.tar.gz
Allow saving more than one mlink per mpage in the mlinks ohash.
We are still only using one of them for now. Actually, we are now using a different one, but the order the mlinks are found is random anyway.
-rw-r--r--mandocdb.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 653e325c..bfe5ecaa 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -142,7 +142,6 @@ static void filescan(const char *);
static void *hash_alloc(size_t, void *);
static void hash_free(void *, size_t, void *);
static void *hash_halloc(size_t, void *);
-static int inocheck(const struct stat *);
static void mlink_add(struct mlink *, const struct stat *);
static void mlink_free(struct mlink *);
static void mpages_free(void);
@@ -558,10 +557,6 @@ treescan(void)
if (warnings)
say(path, "Extraneous file");
continue;
- } else if (inocheck(ff->fts_statp)) {
- if (warnings)
- say(path, "Duplicate file");
- continue;
} else if (NULL == (fsec =
strrchr(ff->fts_name, '.'))) {
if ( ! use_all) {
@@ -711,10 +706,6 @@ filescan(const char *file)
exitcode = (int)MANDOCLEVEL_BADARG;
say(file, "Not a regular file");
return;
- } else if (inocheck(&st)) {
- if (warnings)
- say(file, "Duplicate file");
- return;
}
start = buf + strlen(basedir);
mlink = mandoc_calloc(1, sizeof(struct mlink));
@@ -771,20 +762,6 @@ filescan(const char *file)
mlink_add(mlink, &st);
}
-static int
-inocheck(const struct stat *st)
-{
- struct inodev inodev;
- uint32_t hash;
-
- memset(&inodev, 0, sizeof(inodev));
- inodev.st_ino = hash = st->st_ino;
- inodev.st_dev = st->st_dev;
-
- return(NULL != ohash_find(&mpages, ohash_lookup_memory(
- &mpages, (char *)&inodev, sizeof(inodev), hash)));
-}
-
static void
mlink_add(struct mlink *mlink, const struct stat *st)
{