summaryrefslogtreecommitdiffstats
path: root/ax25ipd
diff options
context:
space:
mode:
authorTerry Dawson VK2KTJ <terry@animats.net>2001-09-22 12:39:16 +0000
committerTerry Dawson VK2KTJ <terry@animats.net>2001-09-22 12:39:16 +0000
commit6364520eb4c795e85f7893ba02de860d132c1d2c (patch)
tree1cab5b3607be7d6f056dcb22a4bf0093f7e0a959 /ax25ipd
parentd15d2ecfe78c5c8698b487e9bbc919fb1ea54598 (diff)
Fixed ax25ipd conf file bug, small cosmetic changes
Diffstat (limited to 'ax25ipd')
-rw-r--r--ax25ipd/Makefile.am4
-rw-r--r--ax25ipd/Makefile.in4
-rw-r--r--ax25ipd/ax25ipd.c7
-rw-r--r--ax25ipd/config.c6
4 files changed, 10 insertions, 11 deletions
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,