Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
lib/ipc_shm.c | 24 +++++++++++++-----------
lib/log_blackbox.c | 3 ++-
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/lib/ipc_shm.c b/lib/ipc_shm.c
index 73a1df4..752c92e 100644
--- a/lib/ipc_shm.c
+++ b/lib/ipc_shm.c
@@ -169,11 +169,13 @@ qb_ipcc_shm_connect(struct qb_ipcc_connection * c,
return -errno;
}
- c->request.u.shm.rb =
- qb_rb_open(response->request, c->request.max_msg_size,
- QB_RB_FLAG_SHARED_PROCESS, sizeof(int32_t));
+ c->request.u.shm.rb = qb_rb_open(response->request,
+ c->request.max_msg_size,
+ QB_RB_FLAG_SHARED_PROCESS,
+ sizeof(int32_t));
if (c->request.u.shm.rb == NULL) {
res = -errno;
+ qb_util_perror(LOG_ERR, "qb_rb_open:REQUEST");
goto return_error;
}
c->response.u.shm.rb = qb_rb_open(response->response,
@@ -182,7 +184,7 @@ qb_ipcc_shm_connect(struct qb_ipcc_connection * c,
if (c->response.u.shm.rb == NULL) {
res = -errno;
- perror("qb_rb_open:RESPONSE");
+ qb_util_perror(LOG_ERR, "qb_rb_open:RESPONSE");
goto cleanup_request;
}
c->event.u.shm.rb = qb_rb_open(response->event,
@@ -191,7 +193,7 @@ qb_ipcc_shm_connect(struct qb_ipcc_connection * c,
if (c->event.u.shm.rb == NULL) {
res = -errno;
- perror("qb_rb_open:EVENT");
+ qb_util_perror(LOG_ERR, "qb_rb_open:EVENT");
goto cleanup_request_response;
}
return 0;
@@ -254,12 +256,12 @@ qb_ipcs_shm_connect(struct qb_ipcs_service *s,
sizeof(int32_t));
if (c->request.u.shm.rb == NULL) {
res = -errno;
- perror("qb_rb_open:REQUEST");
+ qb_util_perror(LOG_ERR, "qb_rb_open:REQUEST");
goto cleanup;
}
res = qb_rb_chown(c->request.u.shm.rb, c->euid, c->egid);
if (res != 0) {
- qb_perror(LOG_ERR, "qb_rb_chown:REQUEST");
+ qb_util_perror(LOG_ERR, "qb_rb_chown:REQUEST");
goto cleanup;
}
@@ -269,12 +271,12 @@ qb_ipcs_shm_connect(struct qb_ipcs_service *s,
QB_RB_FLAG_SHARED_PROCESS, 0);
if (c->response.u.shm.rb == NULL) {
res = -errno;
- qb_perror(LOG_ERR, "qb_rb_open:RESPONSE");
+ qb_util_perror(LOG_ERR, "qb_rb_open:RESPONSE");
goto cleanup_request;
}
res = qb_rb_chown(c->response.u.shm.rb, c->euid, c->egid);
if (res != 0) {
- qb_perror(LOG_ERR, "qb_rb_chown:RESPONSE");
+ qb_util_perror(LOG_ERR, "qb_rb_chown:RESPONSE");
goto cleanup_request;
}
@@ -285,12 +287,12 @@ qb_ipcs_shm_connect(struct qb_ipcs_service *s,
if (c->event.u.shm.rb == NULL) {
res = -errno;
- qb_perror(LOG_ERR, "qb_rb_open:EVENT");
+ qb_util_perror(LOG_ERR, "qb_rb_open:EVENT");
goto cleanup_request_response;
}
res = qb_rb_chown(c->event.u.shm.rb, c->euid, c->egid);
if (res != 0) {
- qb_perror(LOG_ERR, "qb_rb_chown:EVENT");
+ qb_util_perror(LOG_ERR, "qb_rb_chown:EVENT");
goto cleanup_all;
}
diff --git a/lib/log_blackbox.c b/lib/log_blackbox.c
index 1c07c2e..e2a1f7e 100644
--- a/lib/log_blackbox.c
+++ b/lib/log_blackbox.c
@@ -21,6 +21,7 @@
#include "os_base.h"
#include <qb/qbrb.h>
+#include "util_int.h"
#include "log_int.h"
static void
@@ -147,7 +148,7 @@ qb_log_blackbox_print_from_file(const char *bb_filename)
fd = open(bb_filename, 0);
if (fd < 0) {
- qb_perror(LOG_ERR, "qb_log_blackbox_print_from_file");
+ qb_util_perror(LOG_ERR, "qb_log_blackbox_print_from_file");
return;
}
instance = qb_rb_create_from_file(fd, 0);
--
1.7.7.6