{
struct lttcomm_sock *sock = zmalloc<lttcomm_sock>();
- if (sock == NULL) {
+ if (sock == nullptr) {
PERROR("zmalloc create sock");
goto end;
}
LTTNG_ASSERT(src);
sock = lttcomm_alloc_sock(src->proto);
- if (sock == NULL) {
+ if (sock == nullptr) {
goto alloc_error;
}
{
int ret;
int _sock_proto;
- struct lttcomm_sock *sock = NULL;
+ struct lttcomm_sock *sock = nullptr;
/* Safety net */
LTTNG_ASSERT(uri);
}
sock = lttcomm_alloc_sock((lttcomm_sock_proto) _sock_proto);
- if (sock == NULL) {
+ if (sock == nullptr) {
goto alloc_error;
}
error:
lttcomm_destroy_sock(sock);
alloc_error:
- return NULL;
+ return nullptr;
}
/*
lttcomm_alloc_relayd_sock(struct lttng_uri *uri, uint32_t major, uint32_t minor)
{
int ret;
- struct lttcomm_sock *tmp_sock = NULL;
+ struct lttcomm_sock *tmp_sock = nullptr;
struct lttcomm_relayd_sock *rsock = zmalloc<lttcomm_relayd_sock>();
LTTNG_ASSERT(uri);
/* Allocate socket object from URI */
tmp_sock = lttcomm_alloc_sock_from_uri(uri);
- if (tmp_sock == NULL) {
+ if (tmp_sock == nullptr) {
goto error_free;
}
error_free:
free(rsock);
error:
- return NULL;
+ return nullptr;
}
/*
return 0;
}
-void lttcomm_init(void)
+void lttcomm_init()
{
const char *env;
long timeout;
errno = 0;
- timeout = strtol(env, NULL, 0);
+ timeout = strtol(env, nullptr, 0);
if (errno != 0 || timeout < -1L) {
PERROR("Network timeout");
} else {
}
}
-unsigned long lttcomm_get_network_timeout(void)
+unsigned long lttcomm_get_network_timeout()
{
return network_timeout;
}