From 4439817d4df10956b884e0d47ac6e3d18c141238 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 5 Dec 2010 07:24:59 +0000 Subject: check wether config file was empty git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@29 e61f0598-a718-4e21-a8f0-0aadfa62ad6b --- src/tcpproxy.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/tcpproxy.c') diff --git a/src/tcpproxy.c b/src/tcpproxy.c index ef71cb4..57d86b3 100644 --- a/src/tcpproxy.c +++ b/src/tcpproxy.c @@ -171,6 +171,14 @@ int main(int argc, char* argv[]) yyinit(&opt, &listeners); yyparse(); + + if(!slist_length(&listeners)) { + log_printf(ERROR, "no listeners defined in config file %s", opt.config_file_); + listener_clear(&listeners); + options_clear(&opt); + log_close(); + exit(-1); + } } priv_info_t priv; -- cgit v1.2.3