Skip to content

Commit

Permalink
Merge pull request #891 from wenningerk/coverity_1.1
Browse files Browse the repository at this point in the history
a few patches to make coverity a little more happy
  • Loading branch information
kgaillot committed Jan 14, 2016
2 parents 71164cc + 93b9f2c commit f0b585a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cib/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ int cib_process_command(xmlNode * request, xmlNode ** reply,
gboolean cib_common_callback(qb_ipcs_connection_t * c, void *data, size_t size,
gboolean privileged);

#if !SUPPORT_PLUGIN
static gboolean cib_read_legacy_mode(void)
{
static gboolean init = TRUE;
Expand All @@ -89,17 +90,18 @@ static gboolean cib_read_legacy_mode(void)

return legacy;
}
#endif

gboolean cib_legacy_mode(void)
{
#if SUPPORT_PLUGIN
return TRUE;
#endif

#else
if(cib_read_legacy_mode()) {
return TRUE;
}
return legacy_mode;
#endif
}


Expand Down
2 changes: 1 addition & 1 deletion crmd/te_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ tengine_stonith_notify(stonith_t * st, stonith_event_t * st_event)

/* In case fenced is already trying to shoot it */
confirm = open("/var/run/cluster/fenced_override", O_NONBLOCK|O_WRONLY);
if (confirm > 0) {
if (confirm >= 0) {
int ignore = 0;
int len = strlen(target_copy);

Expand Down
2 changes: 1 addition & 1 deletion fencing/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,8 +1224,8 @@ stonith_level_register(xmlNode *msg, char **desc)

/* Sanity-check arguments */
if (mode >= 3 || (id <= 0) || (id >= ST_LEVEL_MAX)) {
free(target);
crm_trace("Could not add %s[%d] (%d) to the topology (%d active entries)", target, id, mode, g_hash_table_size(topology));
free(target);
crm_log_xml_err(level, "Bad topology");
return -EINVAL;
}
Expand Down

0 comments on commit f0b585a

Please sign in to comment.