#include <unistd.h>
#include <inttypes.h>
-#include <common/common.h>
-#include <common/compat/errno.h>
+#include <common/common.hpp>
+#include <common/compat/errno.hpp>
-#include "sessiond-comm.h"
+#include "sessiond-comm.hpp"
/* For Unix socket */
-#include <common/unix.h>
+#include <common/unix.hpp>
/* For Inet socket */
-#include "inet.h"
+#include "inet.hpp"
/* For Inet6 socket */
-#include "inet6.h"
+#include "inet6.hpp"
#define NETWORK_TIMEOUT_ENV "LTTNG_NETWORK_SOCKET_TIMEOUT"
*/
struct lttcomm_sock *lttcomm_alloc_sock(enum lttcomm_sock_proto proto)
{
- struct lttcomm_sock *sock;
+ struct lttcomm_sock *sock = zmalloc<lttcomm_sock>();
- sock = (lttcomm_sock *) zmalloc(sizeof(lttcomm_sock));
if (sock == NULL) {
PERROR("zmalloc create sock");
goto end;
{
int ret;
struct lttcomm_sock *tmp_sock = NULL;
- struct lttcomm_relayd_sock *rsock = NULL;
+ struct lttcomm_relayd_sock *rsock = zmalloc<lttcomm_relayd_sock>();
LTTNG_ASSERT(uri);
- rsock = (lttcomm_relayd_sock *) zmalloc(sizeof(*rsock));
if (!rsock) {
PERROR("zmalloc relayd sock");
goto error;