Skip to content

Commit

Permalink
Refactor: fencing: More appropriate error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
beekhof committed Mar 22, 2013
1 parent 7da5b1b commit 1a25582
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions fencing/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ stonith_fence_get_devices_cb(GList * devices, void *user_data)
}

/* no device found! */
stonith_send_async_reply(cmd, NULL, -EHOSTUNREACH, 0);
stonith_send_async_reply(cmd, NULL, -ENODEV, 0);

free_async_command(cmd);
g_list_free_full(devices, free);
Expand All @@ -1571,7 +1571,6 @@ static int
stonith_fence(xmlNode * msg)
{
const char *device_id = NULL;
int rc = -EHOSTUNREACH;
stonith_device_t *device = NULL;
async_command_t *cmd = create_async_command(msg);
xmlNode *dev = get_xpath_object("//@" F_STONITH_TARGET, msg, LOG_ERR);
Expand All @@ -1585,10 +1584,10 @@ stonith_fence(xmlNode * msg)
device = g_hash_table_lookup(device_list, device_id);
if (device == NULL) {
crm_err("Requested device '%s' is not available", device_id);
} else {
schedule_stonith_command(cmd, device);
rc = -EINPROGRESS;
return -ENODEV;
}
schedule_stonith_command(cmd, device);

} else {
const char *host = crm_element_value(dev, F_STONITH_TARGET);

Expand All @@ -1602,10 +1601,9 @@ stonith_fence(xmlNode * msg)
}
get_capable_devices(host, cmd->action, cmd->default_timeout, cmd,
stonith_fence_get_devices_cb);
rc = -EINPROGRESS;
}

return rc;
return -EINPROGRESS;
}

xmlNode *
Expand Down

0 comments on commit 1a25582

Please sign in to comment.