summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-02-04 12:48:07 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-02-04 12:48:07 +0000
commit12efd15a33b3f47ebe0e8d2755ca4aa7deeb78b6 (patch)
tree03b32250238a47bb7e0d7f16abbb4b111b51269c
parent0cbc6e91dacbaed443ecf888c273c480c8bebb5e (diff)
Minor ldapd -r tweaks
- fix style - the string pointed to by datadir shouldn't be modified, use const - initialize datadir at compile time - in namespace.c, move the extern datadir decl above local decls
-rw-r--r--usr.sbin/ldapd/ldapd.c5
-rw-r--r--usr.sbin/ldapd/namespace.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ldapd/ldapd.c b/usr.sbin/ldapd/ldapd.c
index 49baa296bf4..d8c723d87cc 100644
--- a/usr.sbin/ldapd/ldapd.c
+++ b/usr.sbin/ldapd/ldapd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldapd.c,v 1.18 2016/02/02 14:59:20 gsoares Exp $ */
+/* $OpenBSD: ldapd.c,v 1.19 2016/02/04 12:48:06 jca Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -51,7 +51,7 @@ static void ldapd_cleanup(char *);
struct ldapd_stats stats;
pid_t ldape_pid;
-char * datadir;
+const char *datadir = DATADIR;
void
usage(void)
@@ -120,7 +120,6 @@ main(int argc, char *argv[])
struct event ev_sighup;
struct stat sb;
- datadir = DATADIR;
log_init(1); /* log to stderr until daemonized */
while ((c = getopt(argc, argv, "dhvD:f:nr:s:")) != -1) {
diff --git a/usr.sbin/ldapd/namespace.c b/usr.sbin/ldapd/namespace.c
index e400509b501..052e24de257 100644
--- a/usr.sbin/ldapd/namespace.c
+++ b/usr.sbin/ldapd/namespace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: namespace.c,v 1.15 2016/02/01 20:00:18 landry Exp $ */
+/* $OpenBSD: namespace.c,v 1.16 2016/02/04 12:48:06 jca Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -28,6 +28,8 @@
#include "ldapd.h"
+extern const char *datadir;
+
/* Maximum number of requests to queue per namespace during compaction.
* After this many requests, we return LDAP_BUSY.
*/
@@ -38,7 +40,6 @@ static void namespace_queue_replay(int fd, short event, void *arg);
static int namespace_set_fd(struct namespace *ns,
struct btree **bt, int fd, unsigned int flags);
-extern char *datadir;
int
namespace_begin_txn(struct namespace *ns, struct btree_txn **data_txn,
struct btree_txn **indx_txn, int rdonly)