Refactor sessiond main/cleanup/ht-cleanup
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 18 Dec 2014 01:45:22 +0000 (20:45 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Jan 2015 20:42:20 +0000 (15:42 -0500)
commit4a15001e426da818990dc21f1d423fd04b6cd492
tree7afc0efe45b027c69d6b842db12eed336f90195d
parent73664f816b1512231bf44679eea5a3c91ca619ec
Refactor sessiond main/cleanup/ht-cleanup

Main reason for this entire patchset: move teardown of ht-cleanup thread
_after_ the sessiond cleanup which needs to destroy hash tables. This
fixes leaks at sessiond teardown that makes the valgrind output hard to
use. As this has been done, various other issues with error handling,
leaks, and symmetry of allocation and teardown have been fixed, which
makes this a refactoring.

- Enforce symmetry between allocation and teardown,
- Handle all errors,
- Return all errors as EXIT_FAILURE,
- Standardize on zero being success, nonzero being error,
  (rather than < 0 being error),
- Fix pthread PERROR: we need to store ret into errno before
  calling PERROR, since pthread API does not set errno,
- Join errors now fall-through, rather than rely on the OS
  to teardown the rest.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/ht-cleanup.c
src/bin/lttng-sessiond/lttng-sessiond.h
src/bin/lttng-sessiond/main.c
This page took 0.025605 seconds and 4 git commands to generate.