Skip to content

Commit

Permalink
[usb-moded] Do not retry network when there is no need.
Browse files Browse the repository at this point in the history
The check for the network retry would also run when no
network setup was required. Not anymore.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Sep 24, 2015
1 parent f7fbb9d commit c202fae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/usb_moded-modesetting.c
Expand Up @@ -175,7 +175,7 @@ umount: command = g_strconcat("mount | grep ", mountpath, NULL);
}

/* activate mounts after sleeping 1s to be sure enumeration happened and autoplay will work in windows*/
usleep(1800);
sleep(1);
for(i=0 ; mounts[i] != NULL; i++)
{

Expand Down Expand Up @@ -391,7 +391,7 @@ int set_dynamic_mode(void)

/* try a second time to bring up the network if it failed the first time,
this can happen with functionfs based gadgets (which is why we sleep for a bit */
if(network != 0)
if(network != 0 && data->network)
{
log_debug("Retry setting up the network later\n");
delayed_network = g_timeout_add_seconds(3, network_retry, data);
Expand Down

0 comments on commit c202fae

Please sign in to comment.