diff --git a/src/usb_moded-appsync.c b/src/usb_moded-appsync.c index 3a41491..8e66387 100644 --- a/src/usb_moded-appsync.c +++ b/src/usb_moded-appsync.c @@ -245,14 +245,14 @@ int activate_sync(const char *mode) /* do not launch items marked as post, will be launched after usb is up */ if(data->post) { - mark_active(data->name); + mark_active(data->name, data->post); continue; } log_debug("launching app %s\n", data->name); if(data->systemd) { if(!systemd_control_service(data->name, SYSTEMD_START)) - mark_active(data->name); + mark_active(data->name, 0); else goto error; } @@ -261,11 +261,11 @@ int activate_sync(const char *mode) /* skipping if dbus session bus is not available, or not compiled in */ if(no_dbus) - mark_active(data->name); + mark_active(data->name, 0); #ifdef APP_SYNC_DBUS else if(!usb_moded_dbus_app_launch(data->launch)) - mark_active(data->name); + mark_active(data->name, 0); else goto error; #endif /* APP_SYNC_DBUS */ @@ -338,14 +338,15 @@ int activate_sync_post(const char *mode) return(1); } -int mark_active(const gchar *name) +int mark_active(const gchar *name, int post) { int ret = -1; // assume name not found int missing = 0; GList *iter; - log_debug("App %s notified it is ready\n", name); + if(post) + log_debug("App %s notified it is ready\n", name); for( iter = sync_list; iter; iter = g_list_next(iter) ) { diff --git a/src/usb_moded-appsync.h b/src/usb_moded-appsync.h index ec8ca60..14ae85c 100644 --- a/src/usb_moded-appsync.h +++ b/src/usb_moded-appsync.h @@ -47,7 +47,7 @@ typedef struct list_elem void readlist(int diag); int activate_sync(const char *mode); int activate_sync_post(const char *mode); -int mark_active(const gchar *name); +int mark_active(const gchar *name, int post); int appsync_stop(void); void free_appsync_list(void); void usb_moded_appsync_cleanup(void);