Changeset View
Changeset View
Standalone View
Standalone View
lib/libcasper/libcasper/service.c
Show First 20 Lines • Show All 318 Lines • ▼ Show 20 Lines | if (sock == -1) { | ||||
error = 0; | error = 0; | ||||
} | } | ||||
} else { | } else { | ||||
error = service->s_command(cmd, | error = service->s_command(cmd, | ||||
service_connection_get_limits(sconn), nvlin, nvlout); | service_connection_get_limits(sconn), nvlin, nvlout); | ||||
} | } | ||||
nvlist_destroy(nvlin); | nvlist_destroy(nvlin); | ||||
if (nvlist_error(nvlout) != 0) { | |||||
/* | |||||
* We have to throw away the old nvlist and construct a new | |||||
* one with the error thrown on this nvlist. libnv will refuse | |||||
* to send nvlout if it's in an error state. | |||||
*/ | |||||
if (error == 0) | |||||
error = nvlist_error(nvlout); | |||||
nvlist_destroy(nvlout); | |||||
nvlout = nvlist_create(flags); | |||||
} | |||||
nvlist_add_number(nvlout, "error", (uint64_t)error); | nvlist_add_number(nvlout, "error", (uint64_t)error); | ||||
if (cap_send_nvlist(service_connection_get_chan(sconn), nvlout) == -1) | if (cap_send_nvlist(service_connection_get_chan(sconn), nvlout) == -1) | ||||
service_connection_remove(service, sconn); | service_connection_remove(service, sconn); | ||||
nvlist_destroy(nvlout); | nvlist_destroy(nvlout); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |