example/test: check for error in qb_ipc_run()

Hopefully all of them this time.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
Angus Salkeld 2012-11-08 20:53:21 +11:00
parent ecf3d6f854
commit c533b24efa
2 changed files with 19 additions and 3 deletions

View File

@ -352,7 +352,12 @@ main(int32_t argc, char *argv[])
glib_loop = g_main_loop_new(NULL, FALSE);
gio_map = qb_array_create_2(16, sizeof(struct gio_to_qb_poll), 1);
qb_ipcs_poll_handlers_set(s1, &glib_ph);
qb_ipcs_run(s1);
rc = qb_ipcs_run(s1);
if (rc != 0) {
errno = -rc;
qb_perror(LOG_ERR, "qb_ipcs_run");
exit(1);
}
g_main_loop_run(glib_loop);
#else
qb_log(LOG_ERR,

View File

@ -255,6 +255,7 @@ int32_t main(int32_t argc, char *argv[])
{
const char *options = "nevhmpsug";
int32_t opt;
int32_t rc;
enum qb_ipc_type ipc_type = QB_IPC_SHM;
struct qb_ipcs_service_handlers sh = {
.connection_accept = s1_connection_accept_fn,
@ -323,7 +324,12 @@ int32_t main(int32_t argc, char *argv[])
exit(1);
}
qb_ipcs_poll_handlers_set(s1, &ph);
qb_ipcs_run(s1);
rc = qb_ipcs_run(s1);
if (rc != 0) {
errno = -rc;
qb_perror(LOG_ERR, "qb_ipcs_run");
exit(1);
}
qb_loop_run(bms_loop);
} else {
#ifdef HAVE_GLIB
@ -337,7 +343,12 @@ int32_t main(int32_t argc, char *argv[])
exit(1);
}
qb_ipcs_poll_handlers_set(s1, &glib_ph);
qb_ipcs_run(s1);
rc = qb_ipcs_run(s1);
if (rc != 0) {
errno = -rc;
qb_perror(LOG_ERR, "qb_ipcs_run");
exit(1);
}
g_main_loop_run(glib_loop);
#else