Module Name: src
Committed By: joerg
Date: Sat Jul 21 22:49:37 UTC 2012
Modified Files:
src/lib/libc/cdb: cdbw.c
Log Message:
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.4 -r1.5 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.4 src/lib/libc/cdb/cdbw.c:1.5
--- src/lib/libc/cdb/cdbw.c:1.4 Sun Jun 3 21:02:50 2012
+++ src/lib/libc/cdb/cdbw.c Sat Jul 21 22:49:37 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cdbw.c,v 1.4 2012/06/03 21:02:50 joerg Exp $ */
+/* $NetBSD: cdbw.c,v 1.5 2012/07/21 22:49:37 joerg 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.4 2012/06/03 21:02:50 joerg Exp $");
+__RCSID("$NetBSD: cdbw.c,v 1.5 2012/07/21 22:49:37 joerg 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;
}
}