mobile: Print an error message if the VTY cannot be initialized

If we fail to initialize the VTY, print an error mesage instead of
failing silently. For example:
"Cannot init VTY on 127.0.0.1 port 4247: Address already in use"

Change-Id: I24161f53fa621ae1c8b1916bd0c8055c494b531e
This commit is contained in:
Stefan Sperling 2018-01-18 15:38:05 +01:00
parent 96e5f8cbe5
commit df1049f380
1 changed files with 4 additions and 1 deletions

View File

@ -464,8 +464,11 @@ int l23_app_init(int (*mncc_recv)(struct osmocom_ms *ms, int, void *),
}
vty_reading = 0;
rc = telnet_init_dynif(l23_ctx, NULL, vty_ip, vty_port);
if (rc < 0)
if (rc < 0) {
fprintf(stderr, "Cannot init VTY on %s port %u: %s\n",
vty_ip, vty_port, strerror(errno));
return rc;
}
printf("VTY available on %s %u\n", vty_ip, vty_port);
osmo_signal_register_handler(SS_GLOBAL, &global_signal_cb, NULL);