diff options
author | 2010-11-26 14:44:01 +0000 | |
---|---|---|
committer | 2010-11-26 14:44:01 +0000 | |
commit | 69b15837592b5942ec67a5ce41244b9dd4882d15 (patch) | |
tree | 9edd0399348bbb2de0368f60fe9a0ead28a07d99 | |
parent | typo, noticed by Mikolaj Kucharski (diff) | |
download | wireguard-openbsd-69b15837592b5942ec67a5ce41244b9dd4882d15.tar.xz wireguard-openbsd-69b15837592b5942ec67a5ce41244b9dd4882d15.zip |
Unbreak re-indexing by checking if an index entry already exists.
-rw-r--r-- | usr.sbin/ldapd/index.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ldapd/index.c b/usr.sbin/ldapd/index.c index 7de78731327..8d1b0f8d320 100644 --- a/usr.sbin/ldapd/index.c +++ b/usr.sbin/ldapd/index.c @@ -1,4 +1,4 @@ -/* $OpenBSD: index.c,v 1.7 2010/06/26 23:19:42 martinh Exp $ */ +/* $OpenBSD: index.c,v 1.8 2010/11/26 14:44:01 martinh Exp $ */ /* * Copyright (c) 2009 Martin Hedenfalk <martin@bzero.se> @@ -112,7 +112,7 @@ index_attribute(struct namespace *ns, char *attr, struct btval *dn, rc = btree_txn_put(NULL, ns->indx_txn, &key, &val, BT_NOOVERWRITE); free(t); - if (rc == BT_FAIL) + if (rc == -1 && errno != EEXIST) return -1; } @@ -169,7 +169,7 @@ index_rdn(struct namespace *ns, struct btval *dn) log_debug("indexing rdn on %.*s", (int)key.size, (char *)key.data); rc = btree_txn_put(NULL, ns->indx_txn, &key, &val, BT_NOOVERWRITE); btval_reset(&key); - if (rc == BT_FAIL) + if (rc == -1 && errno != EEXIST) return -1; return 0; } |