if (code >= LTTNG_UST_ERR_NR)
code = LTTNG_UST_ERR;
return ustcomm_readable_code[USTCOMM_CODE_OFFSET(code)];
-
}
/*
* is used in normal execution to detect if sessiond is
* alive.
*/
+ if (errno != ECONNREFUSED && errno != ECONNRESET)
+ PERROR("connect");
ret = -errno;
+ if (ret == -ECONNREFUSED || ret == -ECONNRESET)
+ ret = -EPIPE;
goto error_connect;
}
if (ret < 0) {
int shutret;
- if (errno != EPIPE && errno != ECONNRESET)
+ if (errno != EPIPE && errno != ECONNRESET && errno != ECONNREFUSED)
PERROR("recvmsg");
ret = -errno;
- if (ret == -ECONNRESET)
+ if (ret == -ECONNRESET || ret == -ECONNREFUSED)
ret = -EPIPE;
shutret = shutdown(sock, SHUT_RDWR);
if (errno != EPIPE && errno != ECONNRESET) {
PERROR("recvmsg fds");
}
- if (errno == EPIPE || errno == ECONNRESET)
- ret = -errno;
+ ret = -errno;
if (ret == -ECONNRESET)
ret = -EPIPE;
goto end;
}
return lur->ret_code;
default:
- if (len < 0) {
- /* Transport level error */
- if (errno == EPIPE || errno == ECONNRESET)
- len = -errno;
- return len;
- } else {
+ if (len >= 0) {
ERR("incorrect message size: %zd\n", len);
- return len;
}
+ return len;
}
}