1. 09 Apr, 2019 1 commit
  2. 20 Feb, 2019 1 commit
  3. 05 Sep, 2018 2 commits
    • spiiroin's avatar
      [usb-moded] Remove redundant include statements · 176b53cf
      spiiroin authored
      Make all local header files self-sufficient.
      
      Normalize order of including header files, so that header corresponding with
      compilation module is included first, followed by local headers, system
      headers, standard headers, and finally headers from auxiliary libraries.
      
      Remove all include statements that are, or are made redundant by the above
      changes.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      176b53cf
    • spiiroin's avatar
      [usb-moded] Move synchronous mode switch to worker thread. Fixes JB#42757 · 57d404a3
      spiiroin authored
      Mode switching in usb-moded is done via synchronous ipc / otherwise
      blocking operations - which makes usb-moded mainloop unable to process
      for example udev events / dbus requests from clients during the swich
      and causes potentially stale events to be seen after the mode switch.
      
      Separate mode selection from mode activation so that the latter is
      executed from worker thread.
      
      Distribute existing code in manner that makes the selection vs activation,
      or mainloop / worker thread separation more apparent:
      - control.c: Mode selection logic
      - worker.c:  Mode activation logic
      
      And move miscellaneous functions that have accumulated into the main
      usb-moded module to:
      
      - common.c:  Generic helper functions
      - sigpipe.c: Asynchronous signal trapping
      
      Rename all moved functions so that they still have prefix indicating the
      containing module.
      
      Refuse synchronous sleeps in order to terminate ongoing mode switch
      if udev events / other inputs invalidate the target of transition.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      57d404a3