diff options
author | Simo Sorce <simo@redhat.com> | 2012-01-13 12:05:14 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-01-14 16:48:08 -0500 |
commit | abcb0ac958269fbeecf05100f90cc8dd61d811f2 (patch) | |
tree | 9c4074118ab3bdd1882e067aa372d1ee7bc5959f /proxy/src/gssproxy.c | |
parent | 666087f91afd309267b0390fc21f481d3e72317f (diff) | |
download | gss-proxy-abcb0ac958269fbeecf05100f90cc8dd61d811f2.tar.gz gss-proxy-abcb0ac958269fbeecf05100f90cc8dd61d811f2.tar.xz gss-proxy-abcb0ac958269fbeecf05100f90cc8dd61d811f2.zip |
Add utils to read a configuration file
Diffstat (limited to 'proxy/src/gssproxy.c')
-rw-r--r-- | proxy/src/gssproxy.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c index c46edcd..5fc80cb 100644 --- a/proxy/src/gssproxy.c +++ b/proxy/src/gssproxy.c @@ -35,7 +35,7 @@ int main(int argc, const char *argv[]) int opt_interactive = 0; int opt_version = 0; char *opt_config_file = NULL; - char *config_file = NULL; + struct gp_config *config; verto_ctx *vctx; verto_ev *ev; int vflags; @@ -76,22 +76,15 @@ int main(int argc, const char *argv[]) return 1; } - if (!opt_daemon && !opt_interactive) { - opt_daemon = 1; + if (opt_interactive) { + opt_daemon = 2; } - poptFreeContext(pc); - - /* 1. Init server and sockets - * 2. Create thread pools and queues - * 3. Create mainloop and start serving clients - * 4. ... - * 5. Profit - */ + config = read_config(opt_config_file, opt_daemon); init_server(); - fd = init_unix_socket(GSS_PROXY_SOCKET_NAME); + fd = init_unix_socket(config->socket_name); if (fd == -1) { return 1; } @@ -111,5 +104,7 @@ int main(int argc, const char *argv[]) fini_server(); + poptFreeContext(pc); + return 0; } |