commit 979b48c98891f6086a8797e8fa6609c803ce40ab
parent 62b85cc393d2ed727c241cd5ed86549f252404ae
Author: sin <sin@2f30.org>
Date: Wed, 11 Mar 2015 18:46:08 +0000
Add paths.h
Diffstat:
5 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
@@ -22,7 +22,7 @@ all: $(BIN)
$(BIN): $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LDLIBS)
-$(OBJ): arg.h proto.h waffle.h
+$(OBJ): arg.h paths.h proto.h waffle.h
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
diff --git a/ldap.c b/ldap.c
@@ -42,7 +42,7 @@ parse_config(void)
char *key, *val;
char *end;
- fp = fopen("/etc/ldap.conf", "r");
+ fp = fopen(LDAP_CFG_PATH, "r");
while (fp && fgets(buf, sizeof(buf), fp)) {
p = buf;
if (*p == '#' || *p == '\n' || !*p)
diff --git a/paths.h b/paths.h
@@ -0,0 +1,4 @@
+#define SOCKPATH "/var/run/nscd/socket"
+#define PIDFILE "/var/run/waffle.pid"
+
+#define LDAP_CFG_PATH "/etc/ldap.conf"
diff --git a/waffle.c b/waffle.c
@@ -14,9 +14,6 @@
#include "arg.h"
#include "waffle.h"
-#define SOCKPATH "/var/run/nscd/socket"
-#define PIDFILE "/var/run/waffle.pid"
-
int daemonize = 1;
char *argv0;
static fd_set master;
diff --git a/waffle.h b/waffle.h
@@ -1,6 +1,7 @@
#include <sys/types.h>
#include <grp.h>
#include <pwd.h>
+#include "paths.h"
#include "proto.h"
#define LEN(x) (sizeof (x) / sizeof *(x))