diff options
author | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2004-11-08 12:34:01 +0000 |
---|---|---|
committer | Hans-Joerg Hoexer <hshoexer@cvs.openbsd.org> | 2004-11-08 12:34:01 +0000 |
commit | 5f8e52cbeb9e9126071643f52fba8e67e6d49242 (patch) | |
tree | 3f4b139a2953516e1ae82533553332ea4cac981d /sbin/isakmpd/monitor.c | |
parent | e6591197b55de40ad4b3908e24a327ad3d007d48 (diff) |
more monitor cleanup:
remove dead code, some debug messages, prototype monitor_close() to void.
ok ho@
Diffstat (limited to 'sbin/isakmpd/monitor.c')
-rw-r--r-- | sbin/isakmpd/monitor.c | 73 |
1 files changed, 16 insertions, 57 deletions
diff --git a/sbin/isakmpd/monitor.c b/sbin/isakmpd/monitor.c index 7caa4dd2561..ec6481f9f88 100644 --- a/sbin/isakmpd/monitor.c +++ b/sbin/isakmpd/monitor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.31 2004/11/08 12:23:31 hshoexer Exp $ */ +/* $OpenBSD: monitor.c,v 1.32 2004/11/08 12:34:00 hshoexer Exp $ */ /* * Copyright (c) 2003 Håkan Olsson. All rights reserved. @@ -329,45 +329,6 @@ monitor_stat(const char *path, struct stat *sb) } int -monitor_socket(int domain, int type, int protocol) -{ - int s; - int32_t err; - - if (m_write_int32(m_state.s, MONITOR_GET_SOCKET)) - goto errout; - - if (m_write_int32(m_state.s, (int32_t)domain)) - goto errout; - - if (m_write_int32(m_state.s, (int32_t)type)) - goto errout; - - if (m_write_int32(m_state.s, (int32_t)protocol)) - goto errout; - - if (m_read_int32(m_state.s, &err)) - goto errout; - - if (err != 0) { - errno = (int)err; - return -1; - } - /* Read result. */ - s = mm_receive_fd(m_state.s); - if (s < 0) { - log_error("monitor_socket: mm_receive_fd () failed: %s", - strerror(errno)); - return -1; - } - return s; - -errout: - log_error("monitor_socket: problem talking to privileged process"); - return -1; -} - -int monitor_setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen) { @@ -519,13 +480,11 @@ monitor_readdir(struct monitor_dirents *direntries) return NULL; } -int +void monitor_closedir(struct monitor_dirents *direntries) { free(direntries->dirents); free(direntries); - - return 0; } void @@ -634,48 +593,48 @@ monitor_loop(int debug) case MONITOR_UI_INIT: LOG_DBG((LOG_MISC, 80, - "%s: MONITOR_UI_INIT", - __func__)); + "monitor_loop: " + "MONITOR_UI_INIT")); m_priv_test_state(STATE_INIT); m_priv_ui_init(m_state.s); break; case MONITOR_PFKEY_OPEN: LOG_DBG((LOG_MISC, 80, - "%s: MONITOR_PFKEY_OPEN", - __func__)); + "monitor_loop: " + "MONITOR_PFKEY_OPEN")); m_priv_test_state(STATE_INIT); m_priv_pfkey_open(m_state.s); break; case MONITOR_GET_SOCKET: LOG_DBG((LOG_MISC, 80, - "%s: MONITOR_GET_SOCKET", - __func__)); + "monitor_loop: " + "MONITOR_GET_SOCKET")); m_priv_test_state(STATE_INIT); m_priv_getsocket(m_state.s); break; case MONITOR_SETSOCKOPT: LOG_DBG((LOG_MISC, 80, - "%s: MONITOR_SETSOCKOPT", - __func__)); + "monitor_loop: " + "MONITOR_SETSOCKOPT")); m_priv_test_state(STATE_INIT); m_priv_setsockopt(m_state.s); break; case MONITOR_BIND: LOG_DBG((LOG_MISC, 80, - "%s: MONITOR_BIND", - __func__)); + "monitor_loop: " + "MONITOR_BIND")); m_priv_test_state(STATE_INIT); m_priv_bind(m_state.s); break; case MONITOR_INIT_DONE: LOG_DBG((LOG_MISC, 80, - "%s: MONITOR_INIT_DONE", - __func__)); + "monitor_loop: " + "MONITOR_INIT_DONE")); m_priv_test_state(STATE_INIT); m_priv_increase_state( STATE_RUNNING); @@ -683,8 +642,8 @@ monitor_loop(int debug) case MONITOR_SHUTDOWN: LOG_DBG((LOG_MISC, 80, - "%s: MONITOR_SHUTDOWN", - __func__)); + "monitor_loop: " + "MONITOR_SHUTDOWN")); m_priv_increase_state( STATE_QUIT); break; |