From 6364520eb4c795e85f7893ba02de860d132c1d2c Mon Sep 17 00:00:00 2001 From: Terry Dawson VK2KTJ Date: Sat, 22 Sep 2001 12:39:16 +0000 Subject: Fixed ax25ipd conf file bug, small cosmetic changes --- Makefile.am | 4 ++-- Makefile.in | 4 ++-- ax25ipd/Makefile.am | 4 ++-- ax25ipd/Makefile.in | 4 ++-- ax25ipd/ax25ipd.c | 7 +++---- ax25ipd/config.c | 6 +++--- ax25mond/Makefile.am | 4 ++-- ax25rtd/Makefile.am | 4 ++-- ax25rtd/Makefile.in | 4 ++-- 9 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Makefile.am b/Makefile.am index d3a8a78..4e7143f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,8 +6,8 @@ EXTRA_DIST = pathnames.h installconf: @for app in $(SUBDIRS); do $(MAKE) -C $$app installconf; done -AX25_SYSCONFDIR=$(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR=$(localstatedir)/ax25/ +AX25_SYSCONFDIR=$(sysconfdir)/ax25 +AX25_LOCALSTATEDIR=$(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \ -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" diff --git a/Makefile.in b/Makefile.in index 7040b6f..7b482cf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -81,8 +81,8 @@ SUBDIRS = ax25ipd ax25rtd call listen ax25mond EXTRA_DIST = pathnames.h -AX25_SYSCONFDIR = $(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR = $(localstatedir)/ax25/ +AX25_SYSCONFDIR = $(sysconfdir)/ax25 +AX25_LOCALSTATEDIR = $(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" diff --git a/ax25ipd/Makefile.am b/ax25ipd/Makefile.am index 2c1acd6..da5ba61 100644 --- a/ax25ipd/Makefile.am +++ b/ax25ipd/Makefile.am @@ -30,8 +30,8 @@ installconf: $(INSTALL_DATA) $$p $(DESTDIR)$(AX25_SYSCONFDIR)/$$p; \ done -AX25_SYSCONFDIR=$(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR=$(localstatedir)/ax25/ +AX25_SYSCONFDIR=$(sysconfdir)/ax25 +AX25_LOCALSTATEDIR=$(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \ -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" diff --git a/ax25ipd/Makefile.in b/ax25ipd/Makefile.in index d2c6d30..9170cb9 100644 --- a/ax25ipd/Makefile.in +++ b/ax25ipd/Makefile.in @@ -95,8 +95,8 @@ ax25ipd_SOURCES = config.c crc.c io.c kiss.c ax25ipd.c ax25ipd.h proc # Needed so that install is optional etcfiles = ax25ipd.conf -AX25_SYSCONFDIR = $(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR = $(localstatedir)/ax25/ +AX25_SYSCONFDIR = $(sysconfdir)/ax25 +AX25_LOCALSTATEDIR = $(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" diff --git a/ax25ipd/ax25ipd.c b/ax25ipd/ax25ipd.c index 9c6dea1..b75843e 100644 --- a/ax25ipd/ax25ipd.c +++ b/ax25ipd/ax25ipd.c @@ -55,8 +55,7 @@ int main(int argc, char **argv) int option_index = 0; int c; - c = getopt_long(argc, argv, "c:hl:v", options, - &option_index); + c = getopt_long(argc, argv, "c:hl:v", options, &option_index); if (c == -1) break; @@ -65,15 +64,15 @@ int main(int argc, char **argv) break; switch (option_index) { case 0: - case 2: break; case 1: opt_loglevel = atoi(optarg); break; + case 2: + break; case 3: strncpy(opt_configfile, optarg, 1023); break; - } break; case 'c': diff --git a/ax25ipd/config.c b/ax25ipd/config.c index b80d113..063ca37 100644 --- a/ax25ipd/config.c +++ b/ax25ipd/config.c @@ -76,10 +76,10 @@ char *f; int errflag, e, lineno; char *fname; - if (f) - fname = f; + if (f==NULL || strlen(f) == 0) + fname=CONF_AX25IPD_FILE; else - fname = CONF_AX25IPD_FILE; + fname=f; if ((cf = fopen(fname, "r")) == NULL) { fprintf(stderr, diff --git a/ax25mond/Makefile.am b/ax25mond/Makefile.am index 4ccbdc4..6499f30 100644 --- a/ax25mond/Makefile.am +++ b/ax25mond/Makefile.am @@ -19,8 +19,8 @@ installconf: $(INSTALL_DATA) $$p $(DESTDIR)$(AX25_SYSCONFDIR)/$$p; \ done -AX25_SYSCONFDIR=$(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR=$(localstatedir)/ax25/ +AX25_SYSCONFDIR=$(sysconfdir)/ax25 +AX25_LOCALSTATEDIR=$(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \ -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" diff --git a/ax25rtd/Makefile.am b/ax25rtd/Makefile.am index 6e87903..e9edc41 100644 --- a/ax25rtd/Makefile.am +++ b/ax25rtd/Makefile.am @@ -25,8 +25,8 @@ ax25rtd_SOURCES = \ config.c \ listener.c -AX25_SYSCONFDIR=$(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR=$(localstatedir)/ax25/ +AX25_SYSCONFDIR=$(sysconfdir)/ax25 +AX25_LOCALSTATEDIR=$(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \ -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" diff --git a/ax25rtd/Makefile.in b/ax25rtd/Makefile.in index 04306cd..90b01f9 100644 --- a/ax25rtd/Makefile.in +++ b/ax25rtd/Makefile.in @@ -91,8 +91,8 @@ doc_DATA = TODO.ax25rtd README.ax25rtd ax25rtd_SOURCES = ax25rtd.c ax25rtd.h cache_ctl.c cache_dump.c config.c listener.c -AX25_SYSCONFDIR = $(sysconfdir)/ax25/ -AX25_LOCALSTATEDIR = $(localstatedir)/ax25/ +AX25_SYSCONFDIR = $(sysconfdir)/ax25 +AX25_LOCALSTATEDIR = $(localstatedir)/ax25 INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\" -- cgit v1.2.3