Skip to content

Commit

Permalink
inifile: use SYSCONFDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan committed Jan 5, 2014
1 parent 10de92b commit 5c61ce8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions posix.mak
@@ -1,4 +1,5 @@
INSTALL_DIR=$(PWD)/../install
SYSCONFDIR="/etc/"

.PHONY: all clean test install

Expand Down
8 changes: 6 additions & 2 deletions src/inifile.c
Expand Up @@ -34,6 +34,10 @@

#define LOG 0

#ifndef SYSCONFDIR
#define SYSCONFDIR "/etc/"
#endif

char *skipspace(const char *p);


Expand Down Expand Up @@ -72,7 +76,7 @@ const char *inifile(const char *argv0x, const char *inifilex, const char *envsec
* o current directory
* o home directory
* o directory off of argv0
* o /etc/
* o SYSCONFDIR (default=/etc/)
*/
if (FileName::exists(inifile))
{
Expand Down Expand Up @@ -136,7 +140,7 @@ const char *inifile(const char *argv0x, const char *inifilex, const char *envsec
// Search /etc/ for inifile
Letc:
#endif
filename = (char *)FileName::combine((char *)"/etc/", inifile);
filename = (char *)FileName::combine((char *)SYSCONFDIR, inifile);

Ldone:
;
Expand Down
2 changes: 1 addition & 1 deletion src/posix.mak
Expand Up @@ -436,7 +436,7 @@ import.o: import.c
$(CC) -c $(CFLAGS) $<

inifile.o: inifile.c
$(CC) -c $(CFLAGS) $<
$(CC) -c $(CFLAGS) -DSYSCONFDIR='"$(SYSCONFDIR)"' $<

init.o: init.c
$(CC) -c $(CFLAGS) $<
Expand Down

0 comments on commit 5c61ce8

Please sign in to comment.