#include <common/sessiond-comm/relayd.hpp>
#include <common/sessiond-comm/sessiond-comm.hpp>
#include <common/string-utils/format.hpp>
+#include <common/urcu.hpp>
#include <common/uri.hpp>
#include <common/utils.hpp>
#ifdef LTTNG_EMBED_HELP
#include <lttng-relayd.8.h>
#else
- NULL
+ nullptr
#endif
;
{
"control-port",
1,
- 0,
+ nullptr,
'C',
},
{
"data-port",
1,
- 0,
+ nullptr,
'D',
},
{
"live-port",
1,
- 0,
+ nullptr,
'L',
},
{
"daemonize",
0,
- 0,
+ nullptr,
'd',
},
{
"background",
0,
- 0,
+ nullptr,
'b',
},
{
"group",
1,
- 0,
+ nullptr,
'g',
},
{
"fd-pool-size",
1,
- 0,
+ nullptr,
'\0',
},
{
"help",
0,
- 0,
+ nullptr,
'h',
},
{
"output",
1,
- 0,
+ nullptr,
'o',
},
{
"verbose",
0,
- 0,
+ nullptr,
'v',
},
- { "config", 1, 0, 'f' },
- { "version", 0, 0, 'V' },
+ { "config", 1, nullptr, 'f' },
+ { "version", 0, nullptr, 'V' },
{
"working-directory",
1,
- 0,
+ nullptr,
'w',
},
{
"group-output-by-session",
0,
- 0,
+ nullptr,
's',
},
{
"group-output-by-host",
0,
- 0,
+ nullptr,
'p',
},
- { "disallow-clear", 0, 0, 'x' },
+ { "disallow-clear", 0, nullptr, 'x' },
{
- NULL,
- 0,
+ nullptr,
0,
+ nullptr,
0,
},
};
static const char *config_ignore_options[] = { "help", "config", "version" };
-static void print_version(void)
+static void print_version()
{
fprintf(stdout, "%s\n", VERSION);
}
-static void relayd_config_log(void)
+static void relayd_config_log()
{
DBG("LTTng-relayd " VERSION " - " VERSION_NAME "%s%s",
GIT_VERSION[0] == '\0' ? "" : " - " GIT_VERSION,
unsigned long v;
errno = 0;
- v = strtoul(arg, NULL, 0);
+ v = strtoul(arg, nullptr, 0);
if (errno != 0 || !isdigit((unsigned char) arg[0])) {
ERR("Wrong value in --fd-pool-size parameter: %s", arg);
ret = -1;
"-g, --group");
} else {
tracing_group_name = strdup(arg);
- if (tracing_group_name == NULL) {
+ if (tracing_group_name == nullptr) {
ret = -errno;
PERROR("strdup");
goto end;
for (i = 0; i < (sizeof(long_options) / sizeof(struct option)) - 1; i++) {
/* Ignore if entry name is not fully matched. */
- if (strcmp(entry->name, long_options[i].name)) {
+ if (strcmp(entry->name, long_options[i].name) != 0) {
continue;
}
return ret;
}
-static int parse_env_options(void)
+static int parse_env_options()
{
int ret = 0;
- char *value = NULL;
+ char *value = nullptr;
value = lttng_secure_getenv(DEFAULT_LTTNG_RELAYD_WORKING_DIRECTORY_ENV);
if (value) {
return ret;
}
-static int set_fd_pool_size(void)
+static int set_fd_pool_size()
{
int ret = 0;
struct rlimit rlimit;
int c, ret = 0, option_index = 0, retval = 0;
int orig_optopt = optopt, orig_optind = optind;
char *default_address, *optstring;
- char *config_path = NULL;
+ char *config_path = nullptr;
optstring = utils_generate_optstring(long_options,
sizeof(long_options) / sizeof(struct option));
}
ret = config_get_section_entries(
- config_path, config_section_name, config_entry_handler, NULL);
+ config_path, config_section_name, config_entry_handler, nullptr);
if (ret) {
if (ret > 0) {
ERR("Invalid configuration option at line %i", ret);
/* Reset getopt's global state */
optopt = orig_optopt;
optind = orig_optind;
- while (1) {
+ while (true) {
c = getopt_long(argc, argv, optstring, long_options, &option_index);
if (c == -1) {
break;
}
/* assign default values */
- if (control_uri == NULL) {
+ if (control_uri == nullptr) {
ret = asprintf(&default_address,
"tcp://" DEFAULT_NETWORK_CONTROL_BIND_ADDRESS ":%d",
DEFAULT_NETWORK_CONTROL_PORT);
goto exit;
}
}
- if (data_uri == NULL) {
+ if (data_uri == nullptr) {
ret = asprintf(&default_address,
"tcp://" DEFAULT_NETWORK_DATA_BIND_ADDRESS ":%d",
DEFAULT_NETWORK_DATA_PORT);
goto exit;
}
}
- if (live_uri == NULL) {
+ if (live_uri == nullptr) {
ret = asprintf(&default_address,
"tcp://" DEFAULT_NETWORK_VIEWER_BIND_ADDRESS ":%d",
DEFAULT_NETWORK_VIEWER_PORT);
return retval;
}
-static void print_global_objects(void)
+static void print_global_objects()
{
print_viewer_streams();
print_relay_streams();
return 0;
}
-static void untrack_stdio(void)
+static void untrack_stdio()
{
int fds[] = { fileno(stdout), fileno(stderr) };
* noop_close is used since we don't really want to close
* the stdio output fds; we merely want to stop tracking them.
*/
- (void) fd_tracker_close_unsuspendable_fd(the_fd_tracker, fds, 2, noop_close, NULL);
+ (void) fd_tracker_close_unsuspendable_fd(the_fd_tracker, fds, 2, noop_close, nullptr);
}
/*
* Cleanup the daemon
*/
-static void relayd_cleanup(void)
+static void relayd_cleanup()
{
print_global_objects();
/*
* Stop all relayd and relayd-live threads.
*/
-int lttng_relay_stop_threads(void)
+int lttng_relay_stop_threads()
{
int retval = 0;
* Setup signal handler for :
* SIGINT, SIGTERM, SIGPIPE
*/
-static int set_signal_handler(void)
+static int set_signal_handler()
{
int ret = 0;
struct sigaction sa;
sa.sa_flags = 0;
sa.sa_handler = sighandler;
- if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
+ if ((ret = sigaction(SIGTERM, &sa, nullptr)) < 0) {
PERROR("sigaction");
return ret;
}
- if ((ret = sigaction(SIGINT, &sa, NULL)) < 0) {
+ if ((ret = sigaction(SIGINT, &sa, nullptr)) < 0) {
PERROR("sigaction");
return ret;
}
- if ((ret = sigaction(SIGUSR1, &sa, NULL)) < 0) {
+ if ((ret = sigaction(SIGUSR1, &sa, nullptr)) < 0) {
PERROR("sigaction");
return ret;
}
sa.sa_handler = SIG_IGN;
- if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
+ if ((ret = sigaction(SIGPIPE, &sa, nullptr)) < 0) {
PERROR("sigaction");
return ret;
}
return ret;
}
-void lttng_relay_notify_ready(void)
+void lttng_relay_notify_ready()
{
/* Notify the parent of the fork() process that we are ready. */
if (opt_daemon || opt_background) {
*
* Return -1 on error or 0 if all pipes are created.
*/
-static int init_health_quit_pipe(void)
+static int init_health_quit_pipe()
{
return fd_tracker_util_pipe_open_cloexec(
the_fd_tracker, "Health quit pipe", health_quit_pipe);
static struct lttcomm_sock *relay_socket_create(struct lttng_uri *uri, const char *name)
{
int ret, sock_fd;
- struct lttcomm_sock *sock = NULL;
+ struct lttcomm_sock *sock = nullptr;
char uri_str[PATH_MAX];
- char *formated_name = NULL;
+ char *formated_name = nullptr;
sock = lttcomm_alloc_sock_from_uri(uri);
- if (sock == NULL) {
+ if (sock == nullptr) {
ERR("Allocating socket");
goto error;
}
if (ret >= 0) {
ret = asprintf(&formated_name, "%s socket @ %s", name, uri_str);
if (ret < 0) {
- formated_name = NULL;
+ formated_name = nullptr;
}
}
ret = fd_tracker_open_unsuspendable_fd(the_fd_tracker,
&sock_fd,
(const char **) (formated_name ? &formated_name :
- NULL),
+ nullptr),
1,
create_sock,
sock);
lttcomm_destroy_sock(sock);
}
free(formated_name);
- return NULL;
+ return nullptr;
}
static struct lttcomm_sock *accept_relayd_sock(struct lttcomm_sock *listening_sock,
const char *name)
{
int out_fd, ret;
- struct lttcomm_sock *socks[2] = { listening_sock, NULL };
- struct lttcomm_sock *new_sock = NULL;
+ struct lttcomm_sock *socks[2] = { listening_sock, nullptr };
+ struct lttcomm_sock *new_sock = nullptr;
ret = fd_tracker_open_unsuspendable_fd(
the_fd_tracker, &out_fd, (const char **) &name, 1, accept_sock, &socks);
goto error_testpoint;
}
- while (1) {
+ while (true) {
health_code_update();
DBG("Listener accepting connections");
*/
int val = 1;
struct relay_connection *new_conn;
- struct lttcomm_sock *newsock = NULL;
+ struct lttcomm_sock *newsock = nullptr;
enum connection_type type;
if (pollfd == data_sock->fd) {
rcu_unregister_thread();
DBG("Relay listener thread cleanup complete");
lttng_relay_stop_threads();
- return NULL;
+ return nullptr;
}
/*
int err = -1;
ssize_t ret;
struct cds_wfcq_node *node;
- struct relay_connection *new_conn = NULL;
+ struct relay_connection *new_conn = nullptr;
DBG("[thread] Relay dispatcher started");
/* Dequeue commands */
node = cds_wfcq_dequeue_blocking(&relay_conn_queue.head,
&relay_conn_queue.tail);
- if (node == NULL) {
+ if (node == nullptr) {
DBG("Woken up but nothing in the relay command queue");
/* Continue thread execution */
break;
* the data will be read at some point in time
* or wait to the end of the world :)
*/
- ret = lttng_write(relay_conn_pipe[1], &new_conn, sizeof(new_conn));
+ ret = lttng_write(
+ relay_conn_pipe[1], &new_conn, sizeof(new_conn)); /* NOLINT
+ sizeof
+ used
+ on a
+ pointer.
+ */
if (ret < 0) {
PERROR("write connection pipe");
connection_put(new_conn);
goto error;
}
- } while (node != NULL);
+ } while (node != nullptr);
/* Futex wait on queue. Blocking call on futex() */
health_poll_entry();
health_unregister(health_relayd);
DBG("Dispatch thread dying");
lttng_relay_stop_threads();
- return NULL;
+ return nullptr;
}
static bool session_streams_have_index(const struct relay_session *session)
{
int ret = 0;
ssize_t send_ret;
- struct relay_session *session = NULL;
+ struct relay_session *session = nullptr;
struct lttcomm_relayd_create_session_reply_2_11 reply = {};
char session_name[LTTNG_NAME_MAX] = {};
char hostname[LTTNG_HOST_NAME_MAX] = {};
live_timer,
snapshot,
sessiond_uuid,
- id_sessiond.is_set ? &id_sessiond.value : NULL,
- current_chunk_id.is_set ? ¤t_chunk_id.value : NULL,
- creation_time.is_set ? &creation_time.value : NULL,
+ id_sessiond.is_set ? &id_sessiond.value : nullptr,
+ current_chunk_id.is_set ? ¤t_chunk_id.value : nullptr,
+ creation_time.is_set ? &creation_time.value : nullptr,
conn->major,
conn->minor,
session_name_contains_creation_timestamp);
* session lock.
*/
pthread_mutex_lock(&session->lock);
- rcu_read_lock();
+ lttng::urcu::read_lock_guard read_lock;
cds_list_for_each_entry_rcu(stream, &session->recv_list, recv_node)
{
stream_publish(stream);
}
- rcu_read_unlock();
/*
* Inform the viewer that there are new streams in the session.
int ret;
ssize_t send_ret;
struct relay_session *session = conn->session;
- struct relay_stream *stream = NULL;
+ struct relay_stream *stream = nullptr;
struct lttcomm_relayd_status_stream reply;
- struct ctf_trace *trace = NULL;
+ struct ctf_trace *trace = nullptr;
uint64_t stream_handle = -1ULL;
- char *path_name = NULL, *channel_name = NULL;
+ char *path_name = nullptr, *channel_name = nullptr;
uint64_t tracefile_size = 0, tracefile_count = 0;
LTTNG_OPTIONAL(uint64_t) stream_chunk_id = {};
/* We pass ownership of path_name and channel_name. */
stream = stream_create(
trace, stream_handle, path_name, channel_name, tracefile_size, tracefile_count);
- path_name = NULL;
- channel_name = NULL;
+ path_name = nullptr;
+ channel_name = nullptr;
/*
* Streams are the owners of their trace. Reference to trace is
msg.last_net_seq_num = be64toh(msg.last_net_seq_num);
stream = stream_get_by_id(msg.stream_id);
- if (stream == NULL) {
+ if (stream == nullptr) {
ret = -1;
goto end;
}
* to iterate over all streams to find the one associated with
* the right session_id.
*/
- rcu_read_lock();
- cds_lfht_for_each_entry (relay_streams_ht->ht, &iter.iter, stream, node.node) {
- if (!stream_get(stream)) {
- continue;
- }
- if (stream->trace->session->id == msg.session_id) {
- pthread_mutex_lock(&stream->lock);
- stream->data_pending_check_done = false;
- pthread_mutex_unlock(&stream->lock);
- DBG("Set begin data pending flag to stream %" PRIu64,
- stream->stream_handle);
+ {
+ lttng::urcu::read_lock_guard read_lock;
+
+ cds_lfht_for_each_entry (relay_streams_ht->ht, &iter.iter, stream, node.node) {
+ if (!stream_get(stream)) {
+ continue;
+ }
+
+ if (stream->trace->session->id == msg.session_id) {
+ pthread_mutex_lock(&stream->lock);
+ stream->data_pending_check_done = false;
+ pthread_mutex_unlock(&stream->lock);
+ DBG("Set begin data pending flag to stream %" PRIu64,
+ stream->stream_handle);
+ }
+
+ stream_put(stream);
}
- stream_put(stream);
}
- rcu_read_unlock();
memset(&reply, 0, sizeof(reply));
/* All good, send back reply. */
* Iterate over all streams to see if the begin data pending
* flag is set.
*/
- rcu_read_lock();
- cds_lfht_for_each_entry (relay_streams_ht->ht, &iter.iter, stream, node.node) {
- if (!stream_get(stream)) {
- continue;
- }
- if (stream->trace->session->id != msg.session_id) {
- stream_put(stream);
- continue;
- }
- pthread_mutex_lock(&stream->lock);
- if (!stream->data_pending_check_done) {
- uint64_t stream_seq;
+ {
+ lttng::urcu::read_lock_guard read_lock;
- if (session_streams_have_index(conn->session)) {
- /*
- * Ensure that both the index and stream data have been
- * flushed up to the requested point.
- */
- stream_seq =
- std::min(stream->prev_data_seq, stream->prev_index_seq);
- } else {
- stream_seq = stream->prev_data_seq;
+ cds_lfht_for_each_entry (relay_streams_ht->ht, &iter.iter, stream, node.node) {
+ if (!stream_get(stream)) {
+ continue;
}
- if (!stream->closed ||
- !(((int64_t) (stream_seq - stream->last_net_seq_num)) >= 0)) {
- is_data_inflight = 1;
- DBG("Data is still in flight for stream %" PRIu64,
- stream->stream_handle);
- pthread_mutex_unlock(&stream->lock);
+
+ if (stream->trace->session->id != msg.session_id) {
stream_put(stream);
- break;
+ continue;
+ }
+
+ pthread_mutex_lock(&stream->lock);
+ if (!stream->data_pending_check_done) {
+ uint64_t stream_seq;
+
+ if (session_streams_have_index(conn->session)) {
+ /*
+ * Ensure that both the index and stream data have been
+ * flushed up to the requested point.
+ */
+ stream_seq = std::min(stream->prev_data_seq,
+ stream->prev_index_seq);
+ } else {
+ stream_seq = stream->prev_data_seq;
+ }
+
+ if (!stream->closed ||
+ !(((int64_t) (stream_seq - stream->last_net_seq_num)) >= 0)) {
+ is_data_inflight = 1;
+ DBG("Data is still in flight for stream %" PRIu64,
+ stream->stream_handle);
+ pthread_mutex_unlock(&stream->lock);
+ stream_put(stream);
+ break;
+ }
}
+
+ pthread_mutex_unlock(&stream->lock);
+ stream_put(stream);
}
- pthread_mutex_unlock(&stream->lock);
- stream_put(stream);
}
- rcu_read_unlock();
memset(&reply, 0, sizeof(reply));
/* All good, send back reply. */
struct relay_session *session = conn->session;
struct lttcomm_relayd_rotate_streams rotate_streams;
struct lttcomm_relayd_generic_reply reply = {};
- struct relay_stream *stream = NULL;
- struct lttng_trace_chunk *next_trace_chunk = NULL;
+ struct relay_stream *stream = nullptr;
+ struct lttng_trace_chunk *next_trace_chunk = nullptr;
struct lttng_buffer_view stream_positions;
char chunk_id_buf[MAX_INT_DEC_LEN(uint64_t)];
const char *chunk_id_str = "none";
}
stream_put(stream);
- stream = NULL;
+ stream = nullptr;
}
reply_code = LTTNG_OK;
struct lttcomm_relayd_create_trace_chunk *msg;
struct lttcomm_relayd_generic_reply reply = {};
struct lttng_buffer_view header_view;
- struct lttng_trace_chunk *chunk = NULL, *published_chunk = NULL;
+ struct lttng_trace_chunk *chunk = nullptr, *published_chunk = nullptr;
enum lttng_error_code reply_code = LTTNG_OK;
enum lttng_trace_chunk_status chunk_status;
const char *new_path;
if (!session->has_rotated) {
new_path = "";
} else {
- new_path = NULL;
+ new_path = nullptr;
}
} else {
new_path = DEFAULT_CHUNK_TMP_NEW_DIRECTORY;
}
conn->session->pending_closure_trace_chunk = conn->session->current_trace_chunk;
conn->session->current_trace_chunk = published_chunk;
- published_chunk = NULL;
+ published_chunk = nullptr;
if (!conn->session->pending_closure_trace_chunk) {
session->ongoing_rotation = false;
}
struct lttcomm_relayd_close_trace_chunk *msg;
struct lttcomm_relayd_close_trace_chunk_reply reply = {};
struct lttng_buffer_view header_view;
- struct lttng_trace_chunk *chunk = NULL;
+ struct lttng_trace_chunk *chunk = nullptr;
enum lttng_error_code reply_code = LTTNG_OK;
enum lttng_trace_chunk_status chunk_status;
uint64_t chunk_id;
time_t close_timestamp;
char closed_trace_chunk_path[LTTNG_PATH_MAX];
size_t path_length = 0;
- const char *chunk_name = NULL;
+ const char *chunk_name = nullptr;
struct lttng_dynamic_buffer reply_payload;
const char *new_path;
new_path = "";
} else {
/* Use chunk name for new chunk. */
- new_path = NULL;
+ new_path = nullptr;
}
/* Rename new chunk path. */
chunk_status =
if (!session->has_rotated) {
old_path = "";
} else {
- old_path = NULL;
+ old_path = nullptr;
}
/* We need to move back the .tmp_old_chunk to its rightful place. */
chunk_status = lttng_trace_chunk_rename_path(chunk, old_path);
goto end_unlock_session;
}
}
- chunk_status = lttng_trace_chunk_get_name(chunk, &chunk_name, NULL);
+ chunk_status = lttng_trace_chunk_get_name(chunk, &chunk_name, nullptr);
if (chunk_status != LTTNG_TRACE_CHUNK_STATUS_OK) {
ERR("Failed to get chunk name");
ret = -1;
* the last stream releases its reference to it.
*/
lttng_trace_chunk_put(session->current_trace_chunk);
- session->current_trace_chunk = NULL;
+ session->current_trace_chunk = nullptr;
}
lttng_trace_chunk_put(session->pending_closure_trace_chunk);
- session->pending_closure_trace_chunk = NULL;
+ session->pending_closure_trace_chunk = nullptr;
end_unlock_session:
pthread_mutex_unlock(&session->lock);
goto end_stream_unlock;
}
- ret = stream_write(stream, NULL, state->header.padding_size);
+ ret = stream_write(stream, nullptr, state->header.padding_size);
if (ret) {
status = RELAY_CONNECTION_STATUS_ERROR;
goto end_stream_unlock;
* the new state. Don't use it beyond this point.
*/
connection_reset_protocol_state(conn);
- state = NULL;
+ state = nullptr;
end_stream_unlock:
close_requested = stream->close_requested;
(void) lttng_poll_del(events, pollfd);
ret = fd_tracker_close_unsuspendable_fd(
- the_fd_tracker, &pollfd, 1, fd_tracker_util_close_fd, NULL);
+ the_fd_tracker, &pollfd, 1, fd_tracker_util_close_fd, nullptr);
if (ret < 0) {
ERR("Closing pollfd %d", pollfd);
}
struct lttng_poll_event events;
struct lttng_ht *relay_connections_ht;
struct lttng_ht_iter iter;
- struct relay_connection *destroy_conn = NULL;
+ struct relay_connection *destroy_conn = nullptr;
DBG("[thread] Relay worker started");
}
restart:
- while (1) {
+ while (true) {
int idx = -1, i, seen_control = 0, last_notdel_data_fd = -1;
health_code_update();
if (revents & LPOLLIN) {
struct relay_connection *conn;
- ret = lttng_read(relay_conn_pipe[0], &conn, sizeof(conn));
+ ret = lttng_read(relay_conn_pipe[0],
+ &conn,
+ sizeof(conn)); /* NOLINT sizeof used on a
+ pointer. */
if (ret < 0) {
goto error;
}
exit:
error:
/* Cleanup remaining connection object. */
- rcu_read_lock();
- cds_lfht_for_each_entry (relay_connections_ht->ht, &iter.iter, destroy_conn, sock_n.node) {
- health_code_update();
+ {
+ lttng::urcu::read_lock_guard read_lock;
- session_abort(destroy_conn->session);
+ cds_lfht_for_each_entry (
+ relay_connections_ht->ht, &iter.iter, destroy_conn, sock_n.node) {
+ health_code_update();
- /*
- * No need to grab another ref, because we own
- * destroy_conn.
- */
- relay_thread_close_connection(&events, destroy_conn->sock->fd, destroy_conn);
+ session_abort(destroy_conn->session);
+
+ /*
+ * No need to grab another ref, because we own
+ * destroy_conn.
+ */
+ relay_thread_close_connection(
+ &events, destroy_conn->sock->fd, destroy_conn);
+ }
}
- rcu_read_unlock();
(void) fd_tracker_util_poll_clean(the_fd_tracker, &events);
error_poll_create:
health_unregister(health_relayd);
rcu_unregister_thread();
lttng_relay_stop_threads();
- return NULL;
+ return nullptr;
}
/*
* Create the relay command pipe to wake thread_manage_apps.
* Closed in cleanup().
*/
-static int create_relay_conn_pipe(void)
+static int create_relay_conn_pipe()
{
return fd_tracker_util_pipe_open_cloexec(
the_fd_tracker, "Relayd connection pipe", relay_conn_pipe);
return 0;
}
-static int track_stdio(void)
+static int track_stdio()
{
int fds[2];
const char *names[] = { "stdout", "stderr" };
- return fd_tracker_open_unsuspendable_fd(the_fd_tracker, fds, names, 2, stdio_open, NULL);
+ return fd_tracker_open_unsuspendable_fd(the_fd_tracker, fds, names, 2, stdio_open, nullptr);
}
/*
bool thread_is_rcu_registered = false;
int ret = 0, retval = 0;
void *status;
- char *unlinked_file_directory_path = NULL, *output_path = NULL;
+ char *unlinked_file_directory_path = nullptr, *output_path = nullptr;
/* Parse environment variables */
ret = parse_env_options();
}
/* Create thread to manage the client socket */
- ret = pthread_create(
- &health_thread, default_pthread_attr(), thread_manage_health_relayd, (void *) NULL);
+ ret = pthread_create(&health_thread,
+ default_pthread_attr(),
+ thread_manage_health_relayd,
+ (void *) nullptr);
if (ret) {
errno = ret;
PERROR("pthread_create health");
}
/* Setup the dispatcher thread */
- ret = pthread_create(
- &dispatcher_thread, default_pthread_attr(), relay_thread_dispatcher, (void *) NULL);
+ ret = pthread_create(&dispatcher_thread,
+ default_pthread_attr(),
+ relay_thread_dispatcher,
+ (void *) nullptr);
if (ret) {
errno = ret;
PERROR("pthread_create dispatcher");
}
/* Setup the worker thread */
- ret = pthread_create(&worker_thread, default_pthread_attr(), relay_thread_worker, NULL);
+ ret = pthread_create(&worker_thread, default_pthread_attr(), relay_thread_worker, nullptr);
if (ret) {
errno = ret;
PERROR("pthread_create worker");
/* Setup the listener thread */
ret = pthread_create(
- &listener_thread, default_pthread_attr(), relay_thread_listener, (void *) NULL);
+ &listener_thread, default_pthread_attr(), relay_thread_listener, (void *) nullptr);
if (ret) {
errno = ret;
PERROR("pthread_create listener");