Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[usb-moded] Do not print output for post services that are not started
To avoid confusion while debugging, we avoid printing messages
for services that are started in post when they are not actually started.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Sep 24, 2015
1 parent 3baf308 commit f7fbb9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/usb_moded-appsync.c
Expand Up @@ -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;
}
Expand All @@ -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 */
Expand Down Expand Up @@ -338,13 +338,14 @@ 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;

if(post)
log_debug("App %s notified it is ready\n", name);

for( iter = sync_list; iter; iter = g_list_next(iter) )
Expand Down
2 changes: 1 addition & 1 deletion src/usb_moded-appsync.h
Expand Up @@ -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);

0 comments on commit f7fbb9d

Please sign in to comment.