relayd: clean-up: reduce the number of exit paths in main()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 27 Nov 2019 18:20:32 +0000 (13:20 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Jan 2020 06:55:34 +0000 (01:55 -0500)
commit794e2e5f064718252b249e17914c9b2b089d8d0c
tree571a6ac3727e4969a72472985357243f39c0d867
parent896010e38f60e85d757a43778e25a51b890a7443
relayd: clean-up: reduce the number of exit paths in main()

The relay daemons's initialization and teardown relies on a large
number of goto/labels to clean-up on failure to launch.

All of the clean-up can be performed unconditionally by checking for
NULL or uninitialized file descriptors in relayd_cleanup(). This
reduces the number of possible tear-down paths and partly initialized
state to keep track of.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3195caf05b3dd04cc7e9c60dcb322261159fe0df
src/bin/lttng-relayd/health-relayd.c
src/bin/lttng-relayd/main.c
This page took 0.032011 seconds and 4 git commands to generate.