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,
{
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);
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);
}
}
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);
}
}
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;
}
}
/* ------------------------------------------------------------------------ */
-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.
/* 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,