Add error reporting for APRS-IS interface failures
This commit is contained in:
parent
7eca9a09c9
commit
e40f2ded36
1 changed files with 15 additions and 5 deletions
20
bin/if.c
20
bin/if.c
|
@ -127,7 +127,7 @@ error_invalid:
|
|||
static patty_ax25_if *create_aprs_is(struct context *ctx,
|
||||
int argc,
|
||||
char **argv) {
|
||||
enum mode_aprs_is mode = MODE_APRS_IS_IFOPTS;
|
||||
patty_ax25_if *iface;
|
||||
|
||||
patty_ax25_aprs_is_info info = {
|
||||
.user = "N0CALL",
|
||||
|
@ -137,6 +137,8 @@ static patty_ax25_if *create_aprs_is(struct context *ctx,
|
|||
.filter = "m/25"
|
||||
};
|
||||
|
||||
enum mode_aprs_is mode = MODE_APRS_IS_IFOPTS;
|
||||
|
||||
int i;
|
||||
|
||||
if (argc == 0) {
|
||||
|
@ -213,11 +215,19 @@ static patty_ax25_if *create_aprs_is(struct context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
return patty_ax25_if_new( ctx->name,
|
||||
&ctx->addr,
|
||||
patty_ax25_aprs_is_driver(),
|
||||
&info);
|
||||
if ((iface = patty_ax25_if_new( ctx->name,
|
||||
&ctx->addr,
|
||||
patty_ax25_aprs_is_driver(),
|
||||
&info)) == NULL) {
|
||||
patty_error_fmt(ctx->err, "Unable to connect to APRS-IS service %s:%s: %s",
|
||||
info.host, info.port, strerror(errno));
|
||||
|
||||
goto error_if_new;
|
||||
}
|
||||
|
||||
return iface;
|
||||
|
||||
error_if_new:
|
||||
error_invalid:
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue