summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHamish Moffatt <hamish@cloud.net.au>2001-09-11 12:01:10 +0000
committerHamish Moffatt <hamish@cloud.net.au>2001-09-11 12:01:10 +0000
commitb24740e66f03996c6bc2bb2f0832e82ec9f3be29 (patch)
treead1d1d9925a352488b6966417ff630fd1444b541
parentee3367004040be124c754d07e4977ea6dbbc9880 (diff)
Added better error messages in libax25, eg to print out the names
of missing files etc.
-rw-r--r--axconfig.c14
-rw-r--r--nrconfig.c12
-rw-r--r--rsconfig.c8
3 files changed, 17 insertions, 17 deletions
diff --git a/axconfig.c b/axconfig.c
index 6845f3a..4bce997 100644
--- a/axconfig.c
+++ b/axconfig.c
@@ -208,27 +208,27 @@ static int ax25_config_init_port(int fd, int lineno, char *line)
for (p = ax25_ports; p != NULL; p = p->Next) {
if (strcasecmp(name, p->Name) == 0) {
- fprintf(stderr, "axconfig: duplicate port name in line %d of axports file\n", lineno);
+ fprintf(stderr, "axconfig: duplicate port name %s in line %d of axports file\n", name, lineno);
return FALSE;
}
if (strcasecmp(call, p->Call) == 0) {
- fprintf(stderr, "axconfig: duplicate callsign in line %d of axports file\n", lineno);
+ fprintf(stderr, "axconfig: duplicate callsign %s in line %d of axports file\n", call, lineno);
return FALSE;
}
}
if (atoi(baud) < 0) {
- fprintf(stderr, "axconfig: invalid baud rate setting in line %d of axports file\n", lineno);
+ fprintf(stderr, "axconfig: invalid baud rate setting %s in line %d of axports file\n", baud, lineno);
return FALSE;
}
if (atoi(paclen) <= 0) {
- fprintf(stderr, "axconfig: invalid packet size setting in line %d of axports file\n", lineno);
+ fprintf(stderr, "axconfig: invalid packet size setting %s in line %d of axports file\n", paclen, lineno);
return FALSE;
}
if (atoi(window) <= 0) {
- fprintf(stderr, "axconfig: invalid window size setting in line %d of axports file\n", lineno);
+ fprintf(stderr, "axconfig: invalid window size setting %s in line %d of axports file\n", window, lineno);
return FALSE;
}
@@ -305,12 +305,12 @@ int ax25_config_load_ports(void)
int fd, lineno = 1, n = 0;
if ((fp = fopen(CONF_AXPORTS_FILE, "r")) == NULL) {
- fprintf(stderr, "axconfig: unable to open axports file\n");
+ fprintf(stderr, "axconfig: unable to open axports file %s (%s)\n", CONF_AXPORTS_FILE, strerror(errno));
return 0;
}
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- fprintf(stderr, "axconfig: unable to open socket\n");
+ fprintf(stderr, "axconfig: unable to open socket (%s)\n", strerror(errno));
fclose(fp);
return 0;
}
diff --git a/nrconfig.c b/nrconfig.c
index 81cc672..5c86a9f 100644
--- a/nrconfig.c
+++ b/nrconfig.c
@@ -194,21 +194,21 @@ static int nr_config_init_port(int fd, int lineno, char *line)
for (p = nr_ports; p != NULL; p = p->Next) {
if (strcasecmp(name, p->Name) == 0) {
- fprintf(stderr, "nrconfig: duplicate port name in line %d of config file\n", lineno);
+ fprintf(stderr, "nrconfig: duplicate port name %s in line %d of config file\n", name, lineno);
return FALSE;
}
if (strcasecmp(call, p->Call) == 0) {
- fprintf(stderr, "nrconfig: duplicate callsign in line %d of config file\n", lineno);
+ fprintf(stderr, "nrconfig: duplicate callsign %s in line %d of config file\n", call, lineno);
return FALSE;
}
if (strcasecmp(alias, p->Alias) == 0) {
- fprintf(stderr, "nrconfig: duplicate alias in line %d of config file\n", lineno);
+ fprintf(stderr, "nrconfig: duplicate alias %s in line %d of config file\n", alias, lineno);
return FALSE;
}
}
if (atoi(paclen) <= 0) {
- fprintf(stderr, "nrconfig: invalid packet size in line %d of config file\n", lineno);
+ fprintf(stderr, "nrconfig: invalid packet size %s in line %d of config file\n", paclen, lineno);
return FALSE;
}
@@ -285,12 +285,12 @@ int nr_config_load_ports(void)
int fd, lineno = 1, n = 0;
if ((fp = fopen(CONF_NRPORTS_FILE, "r")) == NULL) {
- fprintf(stderr, "nrconfig: unable to open nrports file\n");
+ fprintf(stderr, "nrconfig: unable to open nrports file %s (%s)\n", CONF_NRPORTS_FILE, strerror(errno));
return 0;
}
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- fprintf(stderr, "nrconfig: unable to open socket\n");
+ fprintf(stderr, "nrconfig: unable to open socket (%s)\n", strerror(errno));
fclose(fp);
return 0;
}
diff --git a/rsconfig.c b/rsconfig.c
index cfa4607..7d343e2 100644
--- a/rsconfig.c
+++ b/rsconfig.c
@@ -175,11 +175,11 @@ static int rs_config_init_port(int fd, int lineno, char *line)
for (p = rs_ports; p != NULL; p = p->Next) {
if (strcasecmp(name, p->Name) == 0) {
- fprintf(stderr, "rsconfig: duplicate port name in line %d of config file\n", lineno);
+ fprintf(stderr, "rsconfig: duplicate port name %s in line %d of config file\n", name, lineno);
return FALSE;
}
if (strcasecmp(addr, p->Addr) == 0) {
- fprintf(stderr, "rsconfig: duplicate address in line %d of config file\n", lineno);
+ fprintf(stderr, "rsconfig: duplicate address %s in line %d of config file\n", addr, lineno);
return FALSE;
}
}
@@ -252,12 +252,12 @@ int rs_config_load_ports(void)
int fd, lineno = 1, n = 0;
if ((fp = fopen(CONF_RSPORTS_FILE, "r")) == NULL) {
- fprintf(stderr, "rsconfig: unable to open rsports file\n");
+ fprintf(stderr, "rsconfig: unable to open rsports file %s (%s)\n", CONF_RSPORTS_FILE, strerror(errno));
return 0;
}
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- fprintf(stderr, "rsconfig: unable to open socket\n");
+ fprintf(stderr, "rsconfig: unable to open socket (%s)\n", strerror(errno));
fclose(fp);
return 0;
}