From de2b10441c7835d4221dea3b4414478f72c549f6 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Wed, 30 Aug 2023 16:07:03 +0200 Subject: ipcpd: Revise logging This revises the logging in the IPCPs to be a more consistent and reduce duplicate messages in nested functions. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/local/main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/ipcpd/local/main.c') diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c index a2f8c6dc..ef1c679b 100644 --- a/src/ipcpd/local/main.c +++ b/src/ipcpd/local/main.c @@ -149,25 +149,22 @@ static int local_ipcp_bootstrap(const struct ipcp_config * conf) if (pthread_create(&local_data.packet_loop, NULL, local_ipcp_packet_loop, NULL)) { + log_err("Failed to create pthread: %s", strerror(errno)); ipcp_set_state(IPCP_INIT); return -1; } - log_info("Bootstrapped local IPCP with pid %d.", getpid()); - return 0; } static int local_ipcp_reg(const uint8_t * hash) { if (shim_data_reg_add_entry(local_data.shim_data, hash)) { - log_dbg("Failed to add " HASH_FMT32 " to local registry.", + log_err("Failed to add " HASH_FMT32 " to local registry.", HASH_VAL32(hash)); return -1; } - log_info("Registered " HASH_FMT32 ".", HASH_VAL32(hash)); - return 0; } @@ -226,8 +223,8 @@ static int local_ipcp_flow_alloc_resp(int fd, const void * data, size_t len) { - int out_fd = -1; - time_t mpl = IPCP_LOCAL_MPL; + int out_fd; + time_t mpl = IPCP_LOCAL_MPL; if (ipcp_wait_flow_resp(fd) < 0) return -1; -- cgit v1.2.3