summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/cvs.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2008-06-21 15:39:16 +0000
committerJoris Vink <joris@cvs.openbsd.org>2008-06-21 15:39:16 +0000
commitc580f097f14fce63bc6d06d1d07c188f50dd88b6 (patch)
tree8dd0b43051c0131d8887151ab03ffe17c49020e7 /usr.bin/cvs/cvs.c
parentba611d76d5d400a1020fe2602750c348f1adf039 (diff)
add a hash table mechanism based upon hcreate(3) but one that allows
us to maintain multiple hash tables concurrently. immediatly start using it to keep track of what directories we have already created and what CVS dirs we already created so we do not recreate them when we do not need to. we will be switching more internals to use this soon. rejoice for cheaper lookups. ok tobias@
Diffstat (limited to 'usr.bin/cvs/cvs.c')
-rw-r--r--usr.bin/cvs/cvs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c
index 83b7fbf459d..25d2d6efe62 100644
--- a/usr.bin/cvs/cvs.c
+++ b/usr.bin/cvs/cvs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvs.c,v 1.149 2008/06/17 11:05:39 joris Exp $ */
+/* $OpenBSD: cvs.c,v 1.150 2008/06/21 15:39:15 joris Exp $ */
/*
* Copyright (c) 2006, 2007 Joris Vink <joris@openbsd.org>
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
@@ -37,6 +37,7 @@
#include "cvs.h"
#include "remote.h"
+#include "hash.h"
extern char *__progname;
@@ -80,6 +81,9 @@ volatile sig_atomic_t sig_received = 0;
extern CVSENTRIES *current_list;
+struct hash_table created_directories;
+struct hash_table created_cvs_directories;
+
void
sighandler(int sig)
{
@@ -189,6 +193,9 @@ main(int argc, char **argv)
SLIST_INIT(&repo_locks);
SLIST_INIT(&temp_files);
+ hash_table_init(&created_directories, 100);
+ hash_table_init(&created_cvs_directories, 100);
+
/* check environment so command-line options override it */
if ((envstr = getenv("CVS_RSH")) != NULL)
cvs_rsh = envstr;