Skip to content

Commit

Permalink
[usb_moded] Reject mtp_mode if mtp daemon can't be started
Browse files Browse the repository at this point in the history
Gadget is programmed according to mtp_mode requirements
regardless of availability of mtp daemon - which leaves
non-functional mtp_mode supposedly active.

Switch to fallback mode if mtp daemon can't be started.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Aug 24, 2018
1 parent 439360b commit a7af998
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/usb_moded.c
Expand Up @@ -613,8 +613,10 @@ static void usbmoded_switch_to_mode(const char *mode)
* as they will use the usbmoded_get_usb_mode_data function */
usbmoded_set_usb_mode_data(data);

if( usbmoded_mode_is_mtp_mode(mode) )
usbmoded_start_mtpd();
if( usbmoded_mode_is_mtp_mode(mode) ) {
if( !usbmoded_start_mtpd() )
goto FAILED;
}

if( !usbmoded_set_usb_module(data->mode_module) )
goto FAILED;
Expand Down

0 comments on commit a7af998

Please sign in to comment.