From 5bd459389916a9b703beabf614890a7140e291b2 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Fri, 27 Apr 1990 16:30:44 +0000 Subject: [PATCH] common.h is history clean up calls to network code git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@622 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/main.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/kdc/main.c b/src/kdc/main.c index b35bdb618..3f24d03a6 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -44,7 +44,7 @@ static char rcsid_main_c[] = #include "kdc_util.h" #include "extern.h" -#include "../admin/common.h" +#include "kdc5_err.h" #ifdef notdef /* need to sort out varargs stuff */ @@ -84,6 +84,7 @@ setup_com_err() { initialize_krb5_error_table(); initialize_kdb5_error_table(); + initialize_kdc5_error_table(); initialize_isod_error_table(); #ifdef notdef @@ -280,6 +281,7 @@ int argc; char *argv[]; { krb5_error_code retval; + int errout = 0; if (rindex(argv[0], '/')) argv[0] = rindex(argv[0], '/')+1; @@ -294,14 +296,25 @@ char *argv[]; syslog(LOG_INFO, "commencing operation"); if (retval = init_db(dbm_db_name, master_princ, &master_keyblock)) { - com_err(argv[0], retval, "cannot initialize database"); + com_err(argv[0], retval, ": cannot initialize database"); exit(1); } - setup_network(); /* XXX */ - listen_and_process(); /* XXX */ - closedown_network(); /* XXX */ - - closedown_db(); - exit(0); + if (retval = setup_network(argv[0])) { + com_err(argv[0], retval, "while initializing network"); + exit(1); + } + if (retval = listen_and_process(argv[0])){ + com_err(argv[0], retval, "while processing network requests"); + errout++; + } + if (retval = closedown_network(argv[0])) { + com_err(argv[0], retval, "while shutting down network"); + errout++; + } + if (retval = closedown_db()) { + com_err(argv[0], retval, "while closing database"); + errout++; + } + exit(errout); } -- 2.26.2