From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id rBRGHWex020461 for ; Fri, 27 Dec 2013 11:17:32 -0500 (EST) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id rBRGHWXw005891; Fri, 27 Dec 2013 11:17:32 -0500 (EST) Date: Fri, 27 Dec 2013 11:17:32 -0500 (EST) Message-Id: <201312271617.rBRGHWXw005891@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Allow saving more than one mlink per mpage in the mlinks ohash. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- 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. Modified Files: -------------- mdocml: mandocdb.c Revision Data ------------- Index: mandocdb.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v retrieving revision 1.85 retrieving revision 1.86 diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.85 -r1.86 --- mandocdb.c +++ 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)); @@ -769,20 +760,6 @@ filescan(const char *file) mlink->name = mandoc_strdup(mlink->name); 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 -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv