print error message when config file cannot be opened

Change-Id: I52514adf853c0d2dc5114864f0713e549733786d
This commit is contained in:
Harald Welte 2019-12-04 11:35:14 +01:00
parent cbf23b6465
commit 2c5c079e53
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#include <signal.h>
#include <getopt.h>
#include <errno.h>
#include <osmocom/core/signal.h>
#include <osmocom/core/logging.h>
@ -150,8 +151,11 @@ int main(int argc, char **argv)
handle_options(argc, argv);
rc = vty_read_config_file(g_config_file, NULL);
if (rc < 0)
if (rc < 0) {
fprintf(stderr, "Cannot parse configuration file '%s': %s\n", g_config_file,
strerror(errno));
exit(1);
}
/* start telne tafte reading config for vty_get_bind_adr() */
telnet_init_dynif(rec_tall_ctx, NULL, vty_get_bind_addr(), 4444);