• spiiroin's avatar
    [usb-moded] Fix issues on exit path. MER#1694 · b3e2f370
    spiiroin authored
    Exiting from mainloop does not work as intended, looks like handle_exit()
    is meant to be called from main() function after mainloop is stopped. What
    happens in practice is that handle_exit() gets called from signal handler
    and it makes exit() without ever returning to main() function - which
    means some cleanup tasks are skipped.
    
    In general: Make cleanup tasks happen on the same logical level where
    initialization is made, re-order init/cleanup tasks according to what
    functional inter dependencies exist and add comments describing why
    things are done when they are done.
    
    Remove handle_exit() function and distribute work it used to do among:
    - usb_moded_stop() - exiting from mainloop
    - usb_moded_cleanup() - releasing usb-mode related state/config data
    - main() - cleaning up init steps made from main()
    
    To make possible ordering issues more visible, refuse to send usb-moded
    dbus signals in situations where the service name is not owned by the
    ubs-moded process.
    Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    b3e2f370
Name
Last commit
Last update
config Loading commit data...
debian Loading commit data...
docs Loading commit data...
openembedded Loading commit data...
rpm Loading commit data...
src Loading commit data...
systemd Loading commit data...
utils Loading commit data...
.gitignore Loading commit data...
Copyright Loading commit data...
LICENSE Loading commit data...
Makefile.am Loading commit data...
README.md Loading commit data...
TODO Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
usb-moded.ini Loading commit data...
usb_moded.pc.in Loading commit data...