mirror of
https://salsa.debian.org/ha-team/libqb
synced 2026-08-12 13:04:57 +00:00
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:
parent
ecf3d6f854
commit
c533b24efa
@ -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,
|
||||
|
||||
15
tests/bms.c
15
tests/bms.c
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user