diff options
author | Hamish Moffatt <hamish@cloud.net.au> | 2001-09-11 12:01:10 +0000 |
---|---|---|
committer | Hamish Moffatt <hamish@cloud.net.au> | 2001-09-11 12:01:10 +0000 |
commit | b24740e66f03996c6bc2bb2f0832e82ec9f3be29 (patch) | |
tree | ad1d1d9925a352488b6966417ff630fd1444b541 /axconfig.c | |
parent | ee3367004040be124c754d07e4977ea6dbbc9880 (diff) |
Added better error messages in libax25, eg to print out the names
of missing files etc.
Diffstat (limited to 'axconfig.c')
-rw-r--r-- | axconfig.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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; } |