HomeFreeBSD

daemon: decouple init logic from main loop

Description

daemon: decouple init logic from main loop

main() func contained both initialization and main loop logic.
This made certain operations like restarting problematic and
required dirty hacks in form of goto jumps.

This commit moves the main loop logic into daemon_eventloop(),
cleans up main, and makes restart logic clear: daemon_mainloop()
is run in a loop with a restart condition checked at the end.

Reviewed by: kevans

(cherry picked from commit 4c41f4a0d67fc93cfb07ad5287f02d024d19ef5a)

Details

Provenance
ihor_antonovs.familyAuthored on Mar 23 2023, 2:37 AM
kevansCommitted on Apr 9 2023, 10:49 PM
Parents
rG7ad1bebb0f1d: daemon: move signal setup into a function
Branches
Unknown
Tags
Unknown