• 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
..
Makefile.am Loading commit data...
com.meego.usb_moded.xml Loading commit data...
usb_moded-android.c Loading commit data...
usb_moded-android.h Loading commit data...
usb_moded-appsync-dbus-private.h Loading commit data...
usb_moded-appsync-dbus.c Loading commit data...
usb_moded-appsync-dbus.h Loading commit data...
usb_moded-appsync.c Loading commit data...
usb_moded-appsync.h Loading commit data...
usb_moded-config-private.h Loading commit data...
usb_moded-config.c Loading commit data...
usb_moded-config.h Loading commit data...
usb_moded-dbus-private.h Loading commit data...
usb_moded-dbus.c Loading commit data...
usb_moded-dbus.h Loading commit data...
usb_moded-devicelock.c Loading commit data...
usb_moded-devicelock.h Loading commit data...
usb_moded-dsme.c Loading commit data...
usb_moded-dsme.h Loading commit data...
usb_moded-dyn-config.c Loading commit data...
usb_moded-dyn-config.h Loading commit data...
usb_moded-hw-ab.h Loading commit data...
usb_moded-lock.h Loading commit data...
usb_moded-log.c Loading commit data...
usb_moded-log.h Loading commit data...
usb_moded-mac.c Loading commit data...
usb_moded-mac.h Loading commit data...
usb_moded-modes.h Loading commit data...
usb_moded-modesetting.c Loading commit data...
usb_moded-modesetting.h Loading commit data...
usb_moded-modules-android.c Loading commit data...
usb_moded-modules.c Loading commit data...
usb_moded-modules.h Loading commit data...
usb_moded-network.c Loading commit data...
usb_moded-network.h Loading commit data...
usb_moded-ssu.c Loading commit data...
usb_moded-ssu.h Loading commit data...
usb_moded-systemd.c Loading commit data...
usb_moded-systemd.h Loading commit data...
usb_moded-trigger.c Loading commit data...
usb_moded-trigger.h Loading commit data...
usb_moded-udev.c Loading commit data...
usb_moded-util.c Loading commit data...
usb_moded.c Loading commit data...
usb_moded.h Loading commit data...