Module Name:    src
Committed By:   jdc
Date:           Wed Jul 25 20:50:44 UTC 2012

Modified Files:
        src/lib/libc/cdb [netbsd-6]: cdbw.c

Log Message:
Pull up revision 1.5 (requested by joerg in ticket #436).

Redo hashing, if two of the three individual hashes result in identical
hash modules. This is the trivial case for loops in the 3-graph and got
lost when adopting the nbperf code.


To generate a diff of this commit:
cvs rdiff -u -r1.1.8.1 -r1.1.8.2 src/lib/libc/cdb/cdbw.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/cdb/cdbw.c
diff -u src/lib/libc/cdb/cdbw.c:1.1.8.1 src/lib/libc/cdb/cdbw.c:1.1.8.2
--- src/lib/libc/cdb/cdbw.c:1.1.8.1	Sat Jun 23 22:54:58 2012
+++ src/lib/libc/cdb/cdbw.c	Wed Jul 25 20:50:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdbw.c,v 1.1.8.1 2012/06/23 22:54:58 riz Exp $	*/
+/*	$NetBSD: cdbw.c,v 1.1.8.2 2012/07/25 20:50:44 jdc Exp $	*/
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: cdbw.c,v 1.1.8.1 2012/06/23 22:54:58 riz Exp $");
+__RCSID("$NetBSD: cdbw.c,v 1.1.8.2 2012/07/25 20:50:44 jdc Exp $");
 
 #include "namespace.h"
 
@@ -387,6 +387,13 @@ build_graph(struct cdbw *cdbw, struct st
 			e->middle = hashes[1] % state->entries;
 			e->right = hashes[2] % state->entries;
 
+			if (e->left == e->middle)
+				return -1;
+			if (e->left == e->right)
+				return -1;
+			if (e->middle == e->right)
+				return -1;
+
 			++e;
 		}
 	}

Reply via email to