vhost/rpc: replace strerror with spdk_strerror_r

One instance of strerror() was introduced after the spdk_strerror_r()
function was introduced in commit 4d43844f4d.  Replace it with the
thread-safe version.

Change-Id: I83c6702f7965044ef5fa3577175f89a13dad833f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381601
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2017-10-05 14:42:41 -07:00 committed by Jim Harris
parent f5e27c45da
commit df67486fa9

View File

@ -503,6 +503,7 @@ spdk_rpc_get_vhost_controllers(struct spdk_jsonrpc_request *request,
{
struct rpc_get_vhost_ctrlrs *ctx;
struct spdk_json_write_ctx *w;
char buf[64];
if (params != NULL) {
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
@ -519,7 +520,8 @@ spdk_rpc_get_vhost_controllers(struct spdk_jsonrpc_request *request,
ctx = calloc(1, sizeof(*ctx));
if (ctx == NULL) {
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, strerror(-ENOMEM));
spdk_strerror_r(-ENOMEM, buf, sizeof(buf));
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, buf);
return;
}