Skip to content

Commit

Permalink
tests: ipc: fix the no-GLib conditionalizing
Browse files Browse the repository at this point in the history
In particular, qb_ipcs_rate_limit() needs to be outside the
"#ifdef HAVE_GLIB" conditional, since it gets used regardless.
This should have been like this as of 28e7259.

Signed-off-by: Jan Pokorný <[email protected]>
  • Loading branch information
jnpkrn committed Jun 12, 2019
1 parent b46a574 commit d5adc0c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/check_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ enum my_msg_ids {
};


#ifdef HAVE_GLIB
/* these 2 functions from pacemaker code */
static gint
conv_prio_libqb2glib(enum qb_loop_priority prio)
static enum qb_ipcs_rate_limit
conv_libqb_prio2ratelimit(enum qb_loop_priority prio)
{
gint ret = G_PRIORITY_DEFAULT;
/* this is an inversion of what libqb's qb_ipcs_request_rate_limit does */
enum qb_ipcs_rate_limit ret = QB_IPCS_RATE_NORMAL;
switch (prio) {
case QB_LOOP_LOW:
ret = G_PRIORITY_LOW;
ret = QB_IPCS_RATE_SLOW;
break;
case QB_LOOP_HIGH:
ret = G_PRIORITY_HIGH;
ret = QB_IPCS_RATE_FAST;
break;
default:
qb_log(LOG_DEBUG, "Invalid libqb's loop priority %d,"
Expand All @@ -116,17 +116,17 @@ conv_prio_libqb2glib(enum qb_loop_priority prio)
}
return ret;
}
static enum qb_ipcs_rate_limit
conv_libqb_prio2ratelimit(enum qb_loop_priority prio)
#ifdef HAVE_GLIB
static gint
conv_prio_libqb2glib(enum qb_loop_priority prio)
{
/* this is an inversion of what libqb's qb_ipcs_request_rate_limit does */
enum qb_ipcs_rate_limit ret = QB_IPCS_RATE_NORMAL;
gint ret = G_PRIORITY_DEFAULT;
switch (prio) {
case QB_LOOP_LOW:
ret = QB_IPCS_RATE_SLOW;
ret = G_PRIORITY_LOW;
break;
case QB_LOOP_HIGH:
ret = QB_IPCS_RATE_FAST;
ret = G_PRIORITY_HIGH;
break;
default:
qb_log(LOG_DEBUG, "Invalid libqb's loop priority %d,"
Expand Down

0 comments on commit d5adc0c

Please sign in to comment.