source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Allow saving more than one mlink per mpage in the mlinks ohash.
Date: Fri, 27 Dec 2013 11:17:32 -0500 (EST)	[thread overview]
Message-ID: <201312271617.rBRGHWXw005891@krisdoz.my.domain> (raw)

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

                 reply	other threads:[~2013-12-27 16:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201312271617.rBRGHWXw005891@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).