Trying to negate a uint32_t is kind of difficult so set ret to -1 and
print the actuall host byte order ret code as an error.
Signed-off-by: David Goulet <dgoulet@efficios.com>
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
- ret = -reply.ret_code;
- ERR("Relayd create session replied error %d", ret);
+ ret = -1;
+ ERR("Relayd create session replied error %d", reply.ret_code);
goto error;
} else {
ret = 0;
goto error;
} else {
ret = 0;
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
- ret = -reply.ret_code;
- ERR("Relayd add stream replied error %d", ret);
+ ret = -1;
+ ERR("Relayd add stream replied error %d", reply.ret_code);
} else {
/* Success */
ret = 0;
} else {
/* Success */
ret = 0;
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
- ret = -reply.ret_code;
- ERR("Relayd close stream replied error %d", ret);
+ ret = -1;
+ ERR("Relayd close stream replied error %d", reply.ret_code);
} else {
/* Success */
ret = 0;
} else {
/* Success */
ret = 0;
/* Return session id or negative ret code. */
if (reply.ret_code >= LTTNG_OK) {
/* Return session id or negative ret code. */
if (reply.ret_code >= LTTNG_OK) {
- ret = -reply.ret_code;
- ERR("Relayd data pending replied error %d", ret);
+ ERR("Relayd data pending replied error %d", reply.ret_code);
}
/* At this point, the ret code is either 1 or 0 */
}
/* At this point, the ret code is either 1 or 0 */
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
- ret = -reply.ret_code;
- ERR("Relayd quiescent control replied error %d", ret);
+ ret = -1;
+ ERR("Relayd quiescent control replied error %d", reply.ret_code);
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
/* Return session id or negative ret code. */
if (reply.ret_code != LTTNG_OK) {
- ret = -reply.ret_code;
- ERR("Relayd begin data pending replied error %d", ret);
+ ret = -1;
+ ERR("Relayd begin data pending replied error %d", reply.ret_code);