From 24a254f9e8d3c12f606f22ec7809cfce9da8088b Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Mon, 29 Sep 2008 05:21:46 +0000 Subject: [PATCH] Removed useless init and cleanup functions. Fixed request port list handling. ticket: 6055 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20778 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-thread.h | 2 +- src/util/mac/k5_mig_client.c | 27 ++++++++++++++------------- src/util/mac/k5_mig_server.c | 28 ---------------------------- src/util/mac/k5_mig_server.h | 4 ---- 4 files changed, 15 insertions(+), 46 deletions(-) diff --git a/src/include/k5-thread.h b/src/include/k5-thread.h index 57aa78f4b..a3fb13dcd 100644 --- a/src/include/k5-thread.h +++ b/src/include/k5-thread.h @@ -414,7 +414,7 @@ typedef enum { K5_KEY_CCAPI_REQUEST_PORT, K5_KEY_CCAPI_REPLY_STREAM, K5_KEY_CCAPI_SERVER_DIED, - K5_KEY_IPC_REQUEST_PORT, + K5_KEY_IPC_REQUEST_PORTS, K5_KEY_IPC_REPLY_STREAM, K5_KEY_IPC_SERVER_DIED, K5_KEY_COM_ERR_REENTER, diff --git a/src/util/mac/k5_mig_client.c b/src/util/mac/k5_mig_client.c index d0556fa84..166704204 100644 --- a/src/util/mac/k5_mig_client.c +++ b/src/util/mac/k5_mig_client.c @@ -52,7 +52,7 @@ static int k5_cli_ipc_thread_init (void) { int err = 0; - err = k5_key_register (K5_KEY_IPC_REQUEST_PORT, free); + err = k5_key_register (K5_KEY_IPC_REQUEST_PORTS, free); if (!err) { err = k5_key_register (K5_KEY_IPC_REPLY_STREAM, NULL); @@ -69,7 +69,7 @@ static int k5_cli_ipc_thread_init (void) static void k5_cli_ipc_thread_fini (void) { - k5_key_delete (K5_KEY_IPC_REQUEST_PORT); + k5_key_delete (K5_KEY_IPC_REQUEST_PORTS); k5_key_delete (K5_KEY_IPC_REPLY_STREAM); k5_key_delete (K5_KEY_IPC_SERVER_DIED); } @@ -191,25 +191,25 @@ int32_t k5_ipc_send_request (const char *in_service_id, } if (!err) { - k5_ipc_request_port *request_ports = NULL; + k5_ipc_request_port *port_list = NULL; - request_ports = k5_getspecific (K5_KEY_IPC_REQUEST_PORT); + port_list = k5_getspecific (K5_KEY_IPC_REQUEST_PORTS); - if (!request_ports) { - int size = sizeof (*request_ports) * KIPC_SERVICE_COUNT; + if (!port_list) { + int size = sizeof (*port_list) * KIPC_SERVICE_COUNT; - request_ports = malloc (size); - if (!request_port) { err = ENOMEM; } + port_list = malloc (size); + if (!port_list) { err = ENOMEM; } if (!err) { int i; for (i = 0; i < KIPC_SERVICE_COUNT; i++) { - request_ports[i].service_id = k5_ipc_known_ports [i].service_id; - request_ports[i].port = k5_ipc_known_ports [i].port; + port_list[i].service_id = k5_ipc_known_ports[i].service_id; + port_list[i].port = k5_ipc_known_ports[i].port; } - err = k5_setspecific (K5_KEY_IPC_REQUEST_PORT, request_ports); + err = k5_setspecific (K5_KEY_IPC_REQUEST_PORTS, port_list); } } @@ -217,9 +217,10 @@ int32_t k5_ipc_send_request (const char *in_service_id, int i, found = 0; for (i = 0; i < KIPC_SERVICE_COUNT; i++) { - if (!strcmp (in_service_id, request_ports[i].service_id)) { + if (!strcmp (in_service_id, port_list[i].service_id)) { found = 1; - request_port = &request_ports[i].port; + request_port = &port_list[i].port; + break; } } diff --git a/src/util/mac/k5_mig_server.c b/src/util/mac/k5_mig_server.c index ddf81ce0b..a320ad528 100644 --- a/src/util/mac/k5_mig_server.c +++ b/src/util/mac/k5_mig_server.c @@ -142,34 +142,6 @@ kern_return_t k5_ipc_server_request (mach_port_t in_connection_port, /* ------------------------------------------------------------------------ */ -int32_t k5_ipc_server_initialize (int argc, const char *argv[]) -{ - int32_t err = 0; - - openlog (argv[0], LOG_CONS | LOG_PID, LOG_AUTH); - syslog (LOG_INFO, "Starting up."); - - syslog (LOG_NOTICE, "Exiting: %s (%d)", kipc_error_string (err), err); - - return err; -} - -/* ------------------------------------------------------------------------ */ - -int32_t k5_ipc_server_cleanup (int argc, const char *argv[]) -{ - int32_t err = 0; - - openlog (argv[0], LOG_CONS | LOG_PID, LOG_AUTH); - syslog (LOG_INFO, "Starting up."); - - syslog (LOG_NOTICE, "Exiting: %s (%d)", kipc_error_string (err), err); - - return err; -} - -/* ------------------------------------------------------------------------ */ - int32_t k5_ipc_server_listen_loop (void) { /* Run the Mach IPC listen loop. diff --git a/src/util/mac/k5_mig_server.h b/src/util/mac/k5_mig_server.h index c98d1dc4b..94a68e9a8 100644 --- a/src/util/mac/k5_mig_server.h +++ b/src/util/mac/k5_mig_server.h @@ -41,10 +41,6 @@ int32_t k5_ipc_server_handle_request (mach_port_t in_connection_port, /* Server control functions */ -int32_t k5_ipc_server_initialize (int argc, const char *argv[]); - -int32_t k5_ipc_server_cleanup (int argc, const char *argv[]); - int32_t k5_ipc_server_listen_loop (void); int32_t k5_ipc_server_send_reply (mach_port_t in_reply_pipe, -- 2.26.2