Revert "Fix: remove relayd rundir on cleanup"

This reverts commit 3f28e5619d0a5c2aacef18251b3263bd632199da.

When there are multiple relayd in parallel, we don't want to have a
teardown vs startup race where the directory is removed just after its
supposed creation.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Revert "Fix: remove the rundir at the end of the cleanup"

This reverts commit 43c5442ea57aca20701fd49fba1e3456d48cc7b2.

We cannot remove the toplevel lttng rundir when sessiond exits, now that
it is also used by relayd.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: comment not matching code

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: jul.h include guards

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: sessiond jul.c comments and error path

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
jul-thread.h: cleanup include guards

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Remove jul attach/detach, not needed for now

Not needed, and corner cases not covered.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Comment why we cannot rmdir the lttng and relayd rundir

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
relayd live cleanup

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Implement lttng_read()/lttng_write()

Handle EINTR and partial read/write in wrapper functions.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Use lttng_read/lttng_write wrappers

This ensures we deal with EINTR and partial reads in the same way
everywhere.

This also fixes non-null-terminated string bug in
src/common/compat/compat-epoll.c and src/common/sessiond-comm/inet.c.

Also, lttng_pipe_read() and lttng_pipe_write() return values are changed
to simply match those of lttng_read() and lttng_write(). Their
implementation is replaced by the wrappers, except for locking and
checks.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: add asserts and remove unused variable

Signed-off-by: David Goulet <dgoulet@efficios.com>