Signed-off-by: Angus Salkeld asalkeld@redhat.com --- lib/ipc_posix_mq.c | 2 +- lib/ipc_shm.c | 6 +++--- lib/ipc_sysv_mq.c | 2 +- lib/ipc_us.c | 16 ++++++++-------- lib/ipcs.c | 2 +- lib/util.c | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lib/ipc_posix_mq.c b/lib/ipc_posix_mq.c index ad84d99..ef682d6 100644 --- a/lib/ipc_posix_mq.c +++ b/lib/ipc_posix_mq.c @@ -241,7 +241,7 @@ static void qb_ipcc_pmq_disconnect(struct qb_ipcc_connection *c) { struct qb_ipc_request_header hdr;
- qb_util_log(LOG_DEBUG, "%s()\n", __func__); + qb_util_log(LOG_DEBUG, "%s()", __func__); if (c->needs_sock_for_poll) { return; } diff --git a/lib/ipc_shm.c b/lib/ipc_shm.c index 114a317..024194b 100644 --- a/lib/ipc_shm.c +++ b/lib/ipc_shm.c @@ -197,7 +197,7 @@ int32_t qb_ipcc_shm_connect(struct qb_ipcc_connection *c, qb_rb_close(c->request.u.shm.rb);
return_error: - qb_util_log(LOG_ERR, "connection failed %s\n", + qb_util_log(LOG_ERR, "connection failed %s", strerror(-res));
return res; @@ -241,7 +241,7 @@ static int32_t qb_ipcs_shm_connect(struct qb_ipcs_service *s, { int32_t res;
- qb_util_log(LOG_DEBUG, "connecting to client [%d]\n", c->pid); + qb_util_log(LOG_DEBUG, "connecting to client [%d]", c->pid);
snprintf(r->request, NAME_MAX, "qb-%s-request-%d-%d", s->name, c->pid, c->setup.u.us.sock); snprintf(r->response, NAME_MAX, "qb-%s-response-%d-%d", s->name, c->pid, c->setup.u.us.sock); @@ -293,7 +293,7 @@ cleanup_request:
cleanup: r->hdr.error = res; - qb_util_log(LOG_ERR, "shm connection FAILED [%s]\n", + qb_util_log(LOG_ERR, "shm connection FAILED [%s]", strerror(-res));
return res; diff --git a/lib/ipc_sysv_mq.c b/lib/ipc_sysv_mq.c index 5b5f1b8..6e62840 100644 --- a/lib/ipc_sysv_mq.c +++ b/lib/ipc_sysv_mq.c @@ -229,7 +229,7 @@ static void qb_ipcc_smq_disconnect(struct qb_ipcc_connection *c) { struct qb_ipc_request_header hdr;
- qb_util_log(LOG_DEBUG, "%s()\n", __func__); + qb_util_log(LOG_DEBUG, "%s()", __func__); //if (c->needs_sock_for_poll) { // return; //} diff --git a/lib/ipc_us.c b/lib/ipc_us.c index c64cd71..231b475 100644 --- a/lib/ipc_us.c +++ b/lib/ipc_us.c @@ -436,7 +436,7 @@ int32_t qb_ipcs_us_publish(struct qb_ipcs_service * s) res = -errno; strerror_r(errno, error_str, 100); qb_util_log(LOG_ERR, - "Cannot create server socket: %s\n", error_str); + "Cannot create server socket: %s", error_str); return res; }
@@ -461,7 +461,7 @@ int32_t qb_ipcs_us_publish(struct qb_ipcs_service * s) if (res == -1 || (res == 0 && !S_ISDIR(stat_out.st_mode))) { res = -errno; qb_util_log(LOG_CRIT, - "Required directory not present %s\n", + "Required directory not present %s", SOCKETDIR); goto error_close; } @@ -477,7 +477,7 @@ int32_t qb_ipcs_us_publish(struct qb_ipcs_service * s) res = -errno; strerror_r(errno, error_str, 100); qb_util_log(LOG_CRIT, - "Could not bind AF_UNIX (%s): %s.\n", + "Could not bind AF_UNIX (%s): %s.", un_addr.sun_path, error_str); goto error_close; } @@ -491,7 +491,7 @@ int32_t qb_ipcs_us_publish(struct qb_ipcs_service * s) #endif if (listen(s->server_sock, SERVER_BACKLOG) == -1) { strerror_r(errno, error_str, 100); - qb_util_log(LOG_ERR, "listen failed: %s.\n", error_str); + qb_util_log(LOG_ERR, "listen failed: %s.", error_str); }
res = s->poll_fns.dispatch_add(s->poll_priority, s->server_sock, @@ -506,7 +506,7 @@ error_close:
int32_t qb_ipcs_us_withdraw(struct qb_ipcs_service * s) { - qb_util_log(LOG_INFO, "withdrawing server sockets\n"); + qb_util_log(LOG_INFO, "withdrawing server sockets"); shutdown(s->server_sock, SHUT_RDWR); close(s->server_sock); return 0; @@ -762,14 +762,14 @@ retry_accept: if (new_fd == -1 && errno == EBADF) { strerror_r(errno, error_str, 100); qb_util_log(LOG_ERR, - "Could not accept Library connection:(fd: %d) [%d] %s\n", + "Could not accept Library connection:(fd: %d) [%d] %s", fd, errno, error_str); return -1; } if (new_fd == -1) { res = -errno; qb_util_log(LOG_ERR, - "Could not accept Library connection: [%d] %s\n", + "Could not accept Library connection: [%d] %s", errno, strerror(-res)); return 0; /* This is an error, but -1 would indicate disconnect from poll loop */ } @@ -808,7 +808,7 @@ static int32_t qb_ipcs_us_connect(struct qb_ipcs_service *s, int32_t res = 0; struct ipc_us_control * ctl;
- qb_util_log(LOG_DEBUG, "connecting to client [%d]\n", c->pid); + qb_util_log(LOG_DEBUG, "connecting to client [%d]", c->pid);
snprintf(r->request, NAME_MAX, "qb-%s-control-%d-%d", s->name, c->pid, c->setup.u.us.sock); diff --git a/lib/ipcs.c b/lib/ipcs.c index 32ed22f..155b0e5 100644 --- a/lib/ipcs.c +++ b/lib/ipcs.c @@ -180,7 +180,7 @@ void qb_ipcs_unref(struct qb_ipcs_service *s) assert(s->ref_count > 0); free_it = qb_atomic_int_dec_and_test(&s->ref_count); if (free_it) { - qb_util_log(LOG_DEBUG, "%s() - destorying\n", __func__); + qb_util_log(LOG_DEBUG, "%s() - destorying", __func__); qb_list_for_each_safe(iter, iter_next, &s->connections) { c = qb_list_entry(iter, struct qb_ipcs_connection, list); if (c == NULL) { diff --git a/lib/util.c b/lib/util.c index 5238d4b..12be4e3 100644 --- a/lib/util.c +++ b/lib/util.c @@ -369,7 +369,7 @@ int32_t qb_util_fd_nonblock_cloexec_set(int32_t fd) res = -errno; strerror_r(errno, error_str, 100); qb_util_log(LOG_CRIT, - "Could not set close-on-exit operation on fd: %s\n", + "Could not set close-on-exit operation on fd: %s", error_str); return res; } @@ -379,7 +379,7 @@ int32_t qb_util_fd_nonblock_cloexec_set(int32_t fd) res = -errno; strerror_r(errno, error_str, 100); qb_util_log(LOG_CRIT, - "Could not set non-blocking operation on fd: %s\n", + "Could not set non-blocking operation on fd: %s", error_str); } return res;